Skip to content

Add @MeasureOffHeapAllocation, @ExpectedOffHeapAllocation, @MaxExpectedOffHeapAllocation  #5

@jeanbisutti

Description

@jeanbisutti
Collaborator

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.

Activity

loicmathieu

loicmathieu commented on Sep 27, 2019

@loicmathieu
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

jeanbisutti commented on Sep 27, 2019

@jeanbisutti
CollaboratorAuthor

@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

loicmathieu commented on Sep 27, 2019

@loicmathieu
Contributor

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

jeanbisutti commented on Sep 27, 2019

@jeanbisutti
CollaboratorAuthor
changed the title [-]Add @MeasureOffHeapAllocation[/-] [+]Add @MeasureOffHeapAllocation, @ExpectedOffHeapAllocation, @MaxExpectedOffHeapAllocation [/+] on Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ featureNew feature or requestjvmJVM annotations

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @loicmathieu@jeanbisutti

        Issue actions

          Add @MeasureOffHeapAllocation, @ExpectedOffHeapAllocation, @MaxExpectedOffHeapAllocation · Issue #5 · quick-perf/quickperf