Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

help with MemoryPoolMXBeans

 
Author
Posts: 974
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A sun developer article suggests code similar to this

Running this (hotspot) might show:

Memory type=Non-heap memory, Pool name=Code Cache,
Memory usage=init = 163840(160K) used = 1724608(1684K) committed = 1736704(1696K) max = 33554432(32768K)

Memory type=Heap memory, Pool name=Eden Space,
Memory usage=init = 524288(512K) used = 287792(281K) committed = 524288(512K) max = 71565312(69888K)

Memory type=Heap memory, Pool name=Survivor Space,
Memory usage=init = 65536(64K) used = 65536(64K) committed = 65536(64K) max = 8912896(8704K)

Memory type=Heap memory, Pool name=Tenured Gen,
Memory usage=init = 1441792(1408K) used = 1735896(1695K) committed = 2093056(2044K) max = 715915264(699136K)

Memory type=Non-heap memory, Pool name=Perm Gen,
Memory usage=init = 8388608(8192K) used = 11914720(11635K) committed = 12058624(11776K) max = 67108864(65536K)


Ok, this code is simple enough, but it doesn't quite let me do
what I want, which is to determine peak total memory usage.

I could sum all the p.getPeakUsage() values in a loop, but
that isn't likely to be accurate because if a bunch of objects
move from the Eden space to the Survivor space they will be
counted twice.

What am I missing here?
[ March 08, 2006: Message edited by: Brian Cole ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic