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

Sync Process leading to Memory Leak Issue causing server RAM to boost #468

Open
mushirneo opened this issue Nov 2, 2023 · 6 comments
Open

Comments

@mushirneo
Copy link

What happened?

Recently I had integrated explorer into my fabric network - the version that i had used was v1.8.0 - I noticed that because of the explorer container there is a syncservice.js file which causes my server RAM to boost suddenly causing memory leak & releases it since it reaches the limit by logging this error in the explorer container also causing UI to load slow

<--- Last few GCs --->

[30:0x5557212f3f60] 1515278 ms: Scavenge 652.3 (674.7) -> 644.8 (674.7) MB, 5.4 / 0.2 ms (average mu = 0.397, current mu = 0.435) allocation failure
[30:0x5557212f3f60] 1515373 ms: Scavenge 652.5 (674.7) -> 645.2 (674.7) MB, 5.4 / 0.1 ms (average mu = 0.397, current mu = 0.435) allocation failure
[30:0x5557212f3f60] 1515465 ms: Scavenge 652.8 (674.7) -> 645.5 (675.2) MB, 5.6 / 0.2 ms (average mu = 0.397, current mu = 0.435) allocation failure

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0x55571cf33439]
Security context: 0x262046880921 <JSObject>
1: mul [0xf5ca809e2c9] [/opt/explorer/node_modules/bn.js/lib/bn.js:~1886] [pc=0x283ba931662f]
(this=0x24151ad9cb81 <BN map = 0x17ed2b928c1>,0x2a1b77fd0b81 <BN map = 0x17ed2b928c1>)
2: mul [0xf5ca80a0041] [/opt/explorer/node_modules/bn.js/lib/bn.js:~3425] [pc=0x283ba9314883]
(this=0x39496967d301 <Mont map = 0x17ed2b92c81>,0x218b6ca68d31 <BN map = 0x17ed...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

What did you expect to happen?

Let the explorer container run properly without memory leak

How can we reproduce it (as minimally and precisely as possible)?

Deploy explorer version 2.0.0 or 1.1.8 version container along with explorerdb integrating it with your fabric-network

Anything else we need to know?

Also it seems this bug was fixed in the earlier 1.4.0 & 1.5.0 versions

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
@manishdas12
Copy link
Contributor

@mushirneo Thanks for notifying us. Going forward we will discuss more on this issues.

@mushirneo
Copy link
Author

@manishdas12 @arsulegai Is there any update on this issue or does it need any extra information? - I am happy to discuss on any explorer monthly meetings if that take place on Discord

@arsulegai
Copy link
Member

@mushirneo please use the latest version releases. One of the upcoming features is to reduce the amount of time taken in sync, new features are added to it. For overloading of memory, we can check if there's a way to tell the underlying runtime what the maximum allowed size is.

@mushirneo
Copy link
Author

@arsulegai - I also used the latest v2.0 release as well but facing the same issue. Currently my server RAM is 4GB (which I know is quite less) but as soon as the RAM consumption increases due to memory leak(sync script) - the explorer stops working & memory is released all at once.
What would you suggest to be plan of action in such a scenario

  1. Increase RAM of my server which would probably need the network to re-deployed?
  2. Wait for the new release where the time taken for sync would reduce as you said

@JungHyeokChoi
Copy link

JungHyeokChoi commented Dec 21, 2023

I also faced the same problem.

I used the v2.0 release.

RAM of server can’t be continuously increased.

How to solve?

@GeorgeNiotis
Copy link

GeorgeNiotis commented May 13, 2024

Tried to create my own explorer regarding discovering of new peers. Im facing same issue regarding memory leakage.
Did you manage to find the issue? Is the issue related to the deprecated node-sdk package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants