<ul>
<li>Run persistence call in thread instead of user thread (serialisation is very slow and had blocked user thread)</li>
<li>Create new snapshot only after persistence is completed to avoid to have 3 daoState objects in memory</li>
<li>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)</li>
</ul>
<p>This change results in about 70 mb less memory usage (10% of about 700 mb normal memory usage).<br>
With vm arguments:<br>
-XX:+UseG1GC<br>
-XX:MaxHeapFreeRatio=10<br>
-XX:MinHeapFreeRatio=5<br>
-XX:+UseStringDeduplication'<br>
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.</p>
<p>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.</p>
<p>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).</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/5609'>https://github.com/bisq-network/bisq/pull/5609</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Optimize DaoState snapshot behaviour</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5609/files#diff-d6598321fae6307142c78aac925715af13aaa4f0a83f080ce8d1a1c11985bd21">core/src/main/java/bisq/core/dao/state/DaoStateSnapshotService.java</a>
    (47)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5609/files#diff-5fdf9387535106477be587a2066e4e7e06810b074dea723204dec17995059bf5">core/src/main/java/bisq/core/dao/state/storage/DaoStateStorageService.java</a>
    (28)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5609/files#diff-cd3a94f2ff05fd585361c919fc2f11874ff9a2fe40aa9ffe818e8ef27713c10f">core/src/main/java/bisq/core/dao/state/storage/DaoStateStore.java</a>
    (5)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/5609.patch'>https://github.com/bisq-network/bisq/pull/5609.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/5609.diff'>https://github.com/bisq-network/bisq/pull/5609.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5609">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNUIFKBBKF5OX5SW4P3TWNKHLANCNFSM475F7XPA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNXP5FYP7KWM5CTDKQDTWNKHLA5CNFSM475F7XPKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4N7LWNOQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5609",
"url": "https://github.com/bisq-network/bisq/pull/5609",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>