0

I have an applet and I need to increase his memory. If I pass this parameter:

    -Xmx=1024m

and execute this code:

    rt = Runtime.getRuntime()
    rt.maxMemory()/1024/1024

It returns 989M

If I instead pass:

    -Xmx=2048m

It returns 154M

Why is this, and how can I increase the maximum available memory for my Applet?

Docu
  • 147
  • 1
  • 15

1 Answers1

1

Xmx option you provide to limit JVM for max memory , now it is upto JVM how much memory it usages at Runtime. When you observed once it was 989M and the other time 154M, even it can go beyond also till it reaches Max Limit. You can not control how much memory applet will use other than giving max limit , JVM will control that.

Vipin
  • 4,851
  • 3
  • 35
  • 65