简体   繁体   中英

JVM Memory for applet

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM