简体   繁体   English

小程序的JVM内存

[英]JVM Memory for applet

I have an applet and I need to increase his memory. 我有一个applet,我需要增加他的记忆力。 If I pass this parameter: 如果我传递此参数:

    -Xmx=1024m

and execute this code: 并执行以下代码:

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

It returns 989M 返回989M

If I instead pass: 如果我改为通过:

    -Xmx=2048m

It returns 154M 返回154M

Why is this, and how can I increase the maximum available memory for my Applet? 为什么会这样,如何增加Applet的最大可用内存?

Xmx option you provide to limit JVM for max memory , now it is upto JVM how much memory it usages at Runtime. 您提供的Xmx选项可以限制JVM的最大内存,现在由JVM决定在运行时使用多少内存。 When you observed once it was 989M and the other time 154M, even it can go beyond also till it reaches Max Limit. 当您观察到一次是989M,另一次是154M时,甚至可以超过它,直到达到最大限制。 You can not control how much memory applet will use other than giving max limit , JVM will control that. 除了给定max limit之外,您无法控制要使用多少小程序,JVM将对此进行控制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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