Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

add tx.FlushDBPages method #4

Merged
merged 3 commits into from
Aug 23, 2017
Merged

add tx.FlushDBPages method #4

merged 3 commits into from
Aug 23, 2017

Conversation

lukechampine
Copy link
Member

This method flushes pages from RES, reducing (perceived) memory scarcity.
I tested this by adding the following code to Sia's consensus set:

go func() {
	for range time.Tick(10 * time.Second) {
		cs.db.Update(func(tx *bolt.Tx) error {
			return tx.FlushDBPages()
		})
	}
}()

The result was, during rescan (specifically, rescanning a renter from height 0) memory usage steadily grew to about 1 GB RES, then dropped to about 200 MB RES once the rescan finished. Once this is merged, we can figure out how to best add intermittent flushing to the various Sia bolt dbs. For example, in the wallet and tpool where we already coalesce transactions with syncDB, we could also flush all pages there.

@DavidVorick DavidVorick merged commit a22e934 into master Aug 23, 2017
lukechampine pushed a commit that referenced this pull request Feb 14, 2018
*: use coreos/bbolt as import path
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants