1

To meet SLA for my http-server, I need to manage time spent in GC. So, I need to minimize new objects per request.

For the beginning, I want just to measure quantity of new objects per request. I tried to do it via heap-dump diffs, but this shows lots of redundant data. I feel, I caught not only objects, created per request.

Is there any simple way to see objects, created per request on average?

Oroboros102
  • 2,214
  • 1
  • 27
  • 41
  • 1
    http://stackoverflow.com/questions/2262620/how-to-find-the-number-of-objects-in-the-heap has few options of counting objects in heap. You may check and scope it to request. – suman j Jun 10 '14 at 13:09
  • I found jvisualvm in that question. Looks like I can use "Sampler". Thanks for the link. – Oroboros102 Jun 10 '14 at 13:14

2 Answers2

0

If the container is WebSphere, there is an option ObjectAllocateCount as mentioned here when you use -XrunpmiJvmpiProfiler option. I have not tried this though.

suman j
  • 6,710
  • 11
  • 58
  • 109
0

Finally I used jvisualvm.

Load your server, run some thousand warm up requests. Open "Monitor" tab, push "perform GC". Then open profiler tab, configure it to save allocation stack traces and run. Run heavy load on server. Wait for 100-200K requests and push "Snapshot".

Enjoy your detailed allocated objects log with stack traces!

Oroboros102
  • 2,214
  • 1
  • 27
  • 41