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 @MeasureOffHeapAllocation, @ExpectedOffHeapAllocation, @MaxExpectedOffHeapAllocation #5

Open
jeanbisutti opened this issue Jun 23, 2019 · 4 comments
Labels
jvm JVM annotations ✨ feature New feature or request

Comments

@jeanbisutti
Copy link
Collaborator

jeanbisutti commented Jun 23, 2019

Off-heap allocation has to be understand as direct memory allocation.
It can be measured with the help of a MBean. Undersatand the implemementations of @MeasureHeapAllocation, @ExpectedHeapAllocation and @MaxExpectedHeapAllocation can help you.

@jeanbisutti jeanbisutti added ✨ feature New feature or request jvm JVM annotations labels Jun 23, 2019
@loicmathieu
Copy link
Contributor

OffHeap is a complex area as there is a lot of different offheap memory pool:

  • metaspace
  • code space
  • direct memory
  • thread stack
  • ... (I'm pretty sure I forget one or two)

I think that offheap should means direct memory.
I also think that metaspace related annotations should be a good addition (maybe on a separate issue).
I aslo think that a naive approach to memory consuption can be done around the concept of resident set size (so the total memory usage of your application process on the OS). This can be easily retrived on linux reading some system file (or launching ps -aux). An annotation that read the RSS of the process before and after the test can be very usefull (again, may be a separate issue)

@jeanbisutti
Copy link
Collaborator Author

jeanbisutti commented Sep 27, 2019

@loicmathieu Yes, in Java world, "Off-heap" is generally undestood as direct memory (see EhCache for example).
If you are interested, you can create an "Add @MeasureLinuxRSS"" issue, develop it and explore its interest from a use case!

@loicmathieu
Copy link
Contributor

loicmathieu commented Sep 27, 2019

OK, so byte allocations on off-heap is a good thing.
And don't forget about the @ExpectedOffHeapAllocation annotation :)

And I think also that Metaspace and RSS measurement should be good additions. I'll create separate issues, I'll work on it in a few weeks if nobody do it before :)

@jeanbisutti
Copy link
Collaborator Author

@loicmathieu Great!

@jeanbisutti jeanbisutti changed the title Add @MeasureOffHeapAllocation Add @MeasureOffHeapAllocation, @ExpectedOffHeapAllocation, @MaxExpectedOffHeapAllocation Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jvm JVM annotations ✨ feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants