[bisq-network/bisq] Optimize DaoState snapshot behaviour (#5609)

chimp1984 notifications at github.com
Tue Jul 6 21:26:45 CEST 2021


- Run persistence call in thread instead of user thread (serialisation is very slow and had blocked user thread)
- Create new snapshot only after persistence is completed to avoid to have 3 daoState objects in memory
- Set DaoState in store to null to let gc remove the old reference (was left there before so we had 3 instances of daoStates in memory)

This change results in about 70 mb less memory usage (10% of about 700 mb normal memory usage).
With vm arguments:
-XX:+UseG1GC
-XX:MaxHeapFreeRatio=10
-XX:MinHeapFreeRatio=5
-XX:+UseStringDeduplication' 
memory reduction is about 30% and total memory gets released (not the case with defaults). In my tests I got about 496 MB instead of about 700 with the master version and no vm arguments.

During parsing or other heavier load the total memory will go up again to about 2GB but gets released after some GC rounds once the load is reduced again.

As those gc settings have impact on performance we should observe it first to see if it works well or continue to fine tune it (or add/find other options).
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5609

-- Commit Summary --

  * Optimize DaoState snapshot behaviour

-- File Changes --

    M core/src/main/java/bisq/core/dao/state/DaoStateSnapshotService.java (47)
    M core/src/main/java/bisq/core/dao/state/storage/DaoStateStorageService.java (28)
    M core/src/main/java/bisq/core/dao/state/storage/DaoStateStore.java (5)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5609.patch
https://github.com/bisq-network/bisq/pull/5609.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5609
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210706/2bef6e5c/attachment.htm>


More information about the bisq-github mailing list