-
Notifications
You must be signed in to change notification settings - Fork 34
Add bangs for avoiding retaining the ProtocolInfo and LedgerDbArgs
#1731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bladyjoker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! I want to see you debug these issues live some day, quite cool you were able to find where the issue was.
|
This comment explains how I found this issue and why I think it has been solved by these changes. The initial problem statement was that when benchmarking the node in the workbench there was not a big observable difference between the InMemory and LMDB backends. This is counterintuitive because the LMDB backend should flush all UTxOs to the backing store, so they should be gone from the heap. Thanks to @fmaste, I got a first heap snapshot using +import GHC.Debug.Stub
-main = do
+main = withGhcDebug $ doand executable cardano-node
...
- build-depends:
+ build-depends: ghc-debug-stub,For this to be useful, the libraries to be inspected need to be compiled with info-tables: Un-retaining the
|
85e9af5 to
06ddffa
Compare
#1731) # The backing store tracer As `lgrTracer` was lazy, and also `>$<` is lazy, the `bsTracer` was a thunk that retained the `LedgerDbArgs` which contain the Genesis ledger state. # The ProtocolInfo As `pInfoConfig` is lazy, the `codecConfig` bind was remaining as a thunk and it was retaining the whole `ProtocolInfo` which contains the Genesis ledger state.





The backing store tracer
As
lgrTracerwas lazy, and also>$<is lazy, thebsTracerwas a thunk that retained theLedgerDbArgswhich contain the Genesis ledger state.The ProtocolInfo
As
pInfoConfigis lazy, thecodecConfigbind was remaining as a thunk and it was retaining the wholeProtocolInfowhich contains the Genesis ledger state.