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

RAM usage skyrockets when opening and closing big JARs #482

Closed
threefusii opened this issue Jan 12, 2024 · 4 comments
Closed

RAM usage skyrockets when opening and closing big JARs #482

threefusii opened this issue Jan 12, 2024 · 4 comments

Comments

@threefusii
Copy link

threefusii commented Jan 12, 2024

Description

May be related to #251.
Opening a lot of files and then closing (aka deleting) them won't release them from the RAM.
Also the "Reload Resources" button will load "deleted" jars from the app.

Steps to reproduce

  1. Download some big heavy (possibly shaded) JAR, like Reposilite JAR.
  2. Cap the bytecode viewer at 2GB of RAM with java -Xmx2G -jar filename.jar.
  3. Open the shaded jar with the viewer. (don't decompile any classes, just open)
  4. On my system it loads to approx 1.5GB RAM and works just fine.
  5. Close the JAR. (Right click and "Delete")
  6. Repeat the steps 3-5. Notice that the RAM usage will grow. Repeat again and again and again. After a few attempts the VM will crash with OutOfMemoryError or the GC will eat your CPU usage. (or both)

Info

OS: Win10 x64
Java: Zulu 21.0.1+12
Bytecode Viewer versions tested: 2.12 (from releases) and a1d9c15 (from actions)

@Konloch
Copy link
Owner

Konloch commented Jan 13, 2024

One work around may be to change the theme, I've encountered this issue on my own machine and my solution is to change the theme over to the System Theme. Then importing jars with lots of assets (files, classes, etc) seems to be a lot more manageable.

@threefusii
Copy link
Author

I'm not sure, but there is a clear memory leak if the GC can't free the memory.
A manual System.gc() on closing/opening or as a button will be good anyway, even if it won't fix the problem.

Also i tested with the "System Theme" and the issue still persists.

@Bl3nd
Copy link
Contributor

Bl3nd commented Jan 17, 2024

Tested the current version, I ran it with -Xmx1024m to see if I can force an OutOfMemory. It never did and it reset the memory usage. Without setting a -Xmx, it keeps building usage until a certain point(in my case it was using about 23% of my 32gb and never grew after that but stayed at the 20-ish %). If you could test it also to see if you get the same results, that'd be great.

@threefusii
Copy link
Author

Yep, the issue seems to be fixed in aea66fe

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

No branches or pull requests

3 participants