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

Add heap usage and measure gc activity #3

Open
kwsta opened this issue Nov 16, 2016 · 3 comments
Open

Add heap usage and measure gc activity #3

kwsta opened this issue Nov 16, 2016 · 3 comments
Assignees

Comments

@kwsta
Copy link

kwsta commented Nov 16, 2016

I think it would beneficial to also understand the memory usage profile of each of the libraries.

I see you mention that isn't included in the README.md. Is it planned for the future?

@kwsta kwsta closed this as completed Nov 16, 2016
@kwsta kwsta reopened this Nov 16, 2016
@fabienrenaud
Copy link
Owner

fabienrenaud commented Nov 16, 2016

It would definitely be beneficial but it's a complex thing to measure in Java since there are:

  • many garbage collectors
  • many JVMs (dalvik, JIT, HotSpot, versions)
  • many different ways of tuning just a simple hotspot VM; and without tuning you'd need to wait for hours/days of intense activity before seeing the memory structure and usage stabilizing.

There is also no clear methodology on how one should do a memory benchmark in Java:
http://stackoverflow.com/questions/27831778/how-to-really-benchmark-the-memory-usage-of-a-java-application
Sure there is something in JMH but it seems hard to use/read/process: http://java-performance.info/introduction-jmh-profilers/

I'll try to think of something but these are the reasons why I haven't done it...
Any help is welcome. :)

@JanecekPetr
Copy link

Sure there is something in JMH but it seems hard to use/read/process: http://java-performance.info/introduction-jmh-profilers

The link is dead now, so I cannot see what it was saying. It should be fairly straightforward to see how much garbage got generated, this is mostly independent from JVM and/or Java version, and completely independent from the chosen GC.

Run with -prof gc and parse out the gc.alloc.rate.norm value: https://hg.openjdk.java.net/code-tools/jmh/file/523c524305e2/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_35_Profilers.java#l170

@fabienrenaud
Copy link
Owner

If anyone wants to tackle this, the project is opened to contributions.

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