Memory optimisations to avoid OOM when the user thread falls behind.
authorMike Hearn <mike@plan99.net>
Tue, 14 Jan 2014 17:49:09 +0000 (18:49 +0100)
committerMike Hearn <mike@plan99.net>
Tue, 14 Jan 2014 17:49:09 +0000 (18:49 +0100)
commitd7b3766c4b856aa1c3ee83b22e3e8b3411e97d85
treebd92d41c3c580c45157554a0c3983288496d65da
parente0b698a2e9e6f652a60b1b5d00a4992a65989ad9
Memory optimisations to avoid OOM when the user thread falls behind.

- Remove needless recalculations of the Bloom filter on any wallet change, instead of just when keys/scripts are added. This may fix one of the privacy leak issues too.
- Run fast catchup/filter recalculations on the dedicated PeerGroup thread instead of abusing the user thread. Resolves a TODO.
- Replace the user thread SingleThreadedExecutor with a custom class that blocks the submitting thread and logs a warning if the queue is saturated, to avoid building up a backlog of closures.
core/src/main/java/com/google/bitcoin/core/PeerGroup.java
core/src/main/java/com/google/bitcoin/utils/Threading.java
core/src/test/java/com/google/bitcoin/core/PeerGroupTest.java