java - How to identify Tenured Space -


i want build memorywarningsystem described in many articles: e.g. in http://www.javaspecialists.eu/archive/issue092.html.

therefore, want identify tenured space this:

    private memorypoolmxbean findtenuredgenpool() {         (memorypoolmxbean pool : managementfactory.getmemorypoolmxbeans()) {                   if(pool tenured space)                     return tenured          }     } 

i have seen 2 different ways identify tenured space

  1. check if pool name equals "ps old gen" and/or "tenured gen".
  2. check whether "pool.gettype() == memorytype.heap && pool.isusagethresholdsupported()"

problem 1: cms old gen? other tenured spaces? should add of them list of tenured names?

problem 2: "safe" way of retrieving tenured space? reliable?

thanks!

for hotspot jvm possible memory pool name old space

  • tenured gen
  • ps old gen
  • cms old gen
  • g1 old gen

for jrockit

  • old space

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -