Skip to content
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

memory leak during block syncing #850

Closed
stefantalpalaru opened this issue Apr 1, 2020 · 10 comments
Closed

memory leak during block syncing #850

stefantalpalaru opened this issue Apr 1, 2020 · 10 comments
Assignees
Labels
💫 memory Issue related to memory consumption, for example leak

Comments

@stefantalpalaru
Copy link
Contributor

To replicate, run a local sim in one terminal tab:

make NIMFLAGS="-d:insecure" eth2_network_simulation

In another tab, start the Prometheus daemon (after the sim starts running, so the conf file has been generated):

cd tests/simulation/prometheus
prometheus

Wait a couple of minutes, then connect an external node that will start syncing blocks (from a third tab):

./tests/simulation/run_node.sh 4

You can do a quick-and-dirty metric visualisation from Prometheus' web interface. Relevant graphs (you also want the "metrics" branch of "vendor/nim-chronos"):

GC's heap:
GC heap

Pending futures:
pending futures

@stefantalpalaru stefantalpalaru added this to the Apr 2020 milestone Apr 1, 2020
@stefantalpalaru stefantalpalaru added the 💫 memory Issue related to memory consumption, for example leak label Apr 1, 2020
@mratsim mratsim added the 📈 Stretch Nice-to-have for the current spring label Apr 7, 2020
@stefantalpalaru
Copy link
Contributor Author

Fixed by #874

@stefantalpalaru
Copy link
Contributor Author

It's back ("Blob" is "seq[byte]"):

img

@stefantalpalaru stefantalpalaru modified the milestones: Apr 2020, May 2020 May 13, 2020
@dryajov
Copy link
Member

dryajov commented May 23, 2020

Potentially addressed by vacp2p/nim-libp2p#187

@stefantalpalaru
Copy link
Contributor Author

Now we're leaking strings:

img

@stefantalpalaru stefantalpalaru modified the milestones: May 2020, June 2020 Jun 3, 2020
@dryajov
Copy link
Member

dryajov commented Jun 3, 2020

yes, notices that, but wasn't 100% sure, seq[byte] is gone completely?

@stefantalpalaru
Copy link
Contributor Author

seq[byte] is gone completely?

No, but looks like it slowed down considerably. Here it is in the second node:

img

@dryajov
Copy link
Member

dryajov commented Jun 3, 2020

Latest master for libp2p has some additional fixes that might address some of this further, but I've definitely seen string leaks even with those, so more digging is required.

@stefantalpalaru stefantalpalaru removed the 📈 Stretch Nice-to-have for the current spring label Jun 3, 2020
@stefantalpalaru
Copy link
Contributor Author

Metrics from a witti client runing on an empty db show memory leaks, open file descriptor leaks and libp2p connection leaks.

make clean-witti
make NIMFLAGS="-d:insecure" SCRIPT_PARAMS="--skipGoerliKey" witti

img

@dryajov
Copy link
Member

dryajov commented Jun 4, 2020

Metrics from a witti client runing on an empty db show memory leaks, open file descriptor leaks and libp2p connection leaks.

make clean-witti
make NIMFLAGS="-d:insecure" SCRIPT_PARAMS="--skipGoerliKey" witti

img

this is potentially fixed in latest master in libp2p, nbc needs to be updated with it.

@arnetheduck
Copy link
Member

resolved by status-im/nim-chronos#130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💫 memory Issue related to memory consumption, for example leak
Projects
None yet
Development

No branches or pull requests

5 participants