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 on prod/dev server #1951

Open
xgo-work opened this issue Apr 4, 2024 · 0 comments
Open

Memory leak on prod/dev server #1951

xgo-work opened this issue Apr 4, 2024 · 0 comments

Comments

@xgo-work
Copy link
Contributor

xgo-work commented Apr 4, 2024

Production instances regularly have heap filling up issues.
The problem is now mitigated by restarting all the instances every night.

This issue is aimed at gathering informations centralize and track those leaks.

Potential culprits are objects that require to be manually disposed, or objects which always keep references on them (can be circual references)

Possibilites that should be investigated

FencedLock used for cache sync (from Hazelcast)

https://docs.hazelcast.org/docs/latest/javadoc/com/hazelcast/cp/lock/FencedLock.html
Needs to be destroyed after use (but not so simple). There seem to be a limited amount though but worth checking out.

there is already admin calls that fetch some of them.
https://wegas-dev.albasim.ch/#/admin/locks

Files retrieval using oak JCR

We need to check wether this is done correctly.
Example from
https://dzone.com/articles/creating-a-content-repository-using-jackrabbit-oak

Node fileNodeParent = session.getNode("pathToParentNode"); // /node1/node2/
Node fileContent = fileNodeParent.getNode("theFile").getNode("jcr:content");
Binary bin = fileContent.getProperty("jcr:data").getBinary();
InputStream stream = bin.getStream();
byte[] bytes = IOUtils.toByteArray(stream);
bin.dispose();
stream.close();

oak JCR Sessions

Each transaction with oak jcr repository happens in a session that has to be opened and closed.

See https://jackrabbit.apache.org/oak/docs/construct.html

In WEGAS session creation and release happens here

https://github.com/Heigvd/Wegas/blob/master/wegas-core/src/main/java/com/wegas/core/jcr/SessionManager.java

But not sure that sessions are closed in all use scenarios

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

1 participant