4

What can happens if you launch and use a heavy java 8 rcp desktop app without specifying the jvm parameters MaxMetaspaceSize and the metaspacesize ?

Is it normal that the memory consumed by the heap memory is almost like the non-heap (metaspace) consumption?

the last question: can the non-specifying of the metapace size parameters causes a crash of the app ?

greg-449
  • 109,219
  • 232
  • 102
  • 145
NashBird99
  • 193
  • 2
  • 12

1 Answers1

7

MaxMetaspaceSize unless specified, is, well, unlimited as in as much memory you have. What you have seen at some point that the meta space is the same as the heap size is possible. BUT, both the heap and meta-space are garbage collected; so those values can quickly change.

Not specifying it, effectively means grow as much as you can (I think even including swap). I don't think the app can crash from that, unless with an OutOfMemory when you are filling the MetaSpace; which I highly doubt personally.

Eugene
  • 117,005
  • 15
  • 201
  • 306
  • Thanks for your valuable answer. According to the diagnostic results (performence and memory consumption charts ...), i noticed that the metaspace is never collected by the GC unlike the heap memory which is regularly collected (In the jvm app configuration none of metaspace size parameters is specified). During some crashs the pid file is not generated, it seems like a drastic crash ( i have 12 Go of RAM) and the app doesn't crash on another computer with 32 Go of RAM with the same jvm configuration (xmx, xms and without metaspace parameters) – NashBird99 Feb 26 '17 at 10:39
  • 3
    This seems to be an urban myth that won’t die. “permgen” has been garbage collected. Always. The main problem was its fixed size. That’s why it looks so strange seeing so many people replacing the obsolete max permgen size setting with a max metaspace size setting, killing the main advantage of the metaspace… – Holger Feb 27 '17 at 11:01
  • @Holger Will setting Maxmetaspace inititate a GC when the threshold is reached? – Robert Ravikumar Apr 22 '19 at 04:23