Solved

Max-heap-size of JVM

Posted on 2003-11-02
12
2,010 Views
Last Modified: 2013-11-23
Dear Experts,
I set these properites in JLNP file
<j2se version="1.3+" initial-heap-size="64m"/>
<j2se version="1.3+" max-heap-size="256m"/>
Result:
I catch OutOfMemory exception when JVM reach 65088 MB
When I change initial-heap-size="64m" ==> initial-heap-size="128m"
The I couldnot start jws.
Could you help me increase more heap size of JVM?
Thank you very much for your help.
0
Comment
Question by:sontnvn
  • 8
  • 4
12 Comments
 
LVL 92

Expert Comment

by:objects
ID: 9669196
> The I couldnot start jws.

why not?
0
 
LVL 92

Expert Comment

by:objects
ID: 9669276
Also perhaps should be:

<j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
0
 
LVL 92

Expert Comment

by:objects
ID: 9669332
0
 

Author Comment

by:sontnvn
ID: 9670385
> <j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
===> Nothing changed
0
 
LVL 92

Expert Comment

by:objects
ID: 9674454
> ===> Nothing changed

Can you explain exactly what is happening.
0
 

Author Comment

by:sontnvn
ID: 9675032
Case 1:
<j2se version="1.3+" initial-heap-size="64m"/>
<j2se version="1.3+" max-heap-size="256m"/>
Case2:
<j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>

In both case, My application throw OutOfMemory exception. I trace memory information and this is the result:
Runtime.getRuntime().totalMemory()/1024 = 65088
Runtime.getRuntime().freeMemory()/1024 = 17638
Runtime.getRuntime().maxMemory()/1024 = 131072
Physical memory is 1GB, why Runtime.getRuntime().maxMemory()/1024 always return 131072?
Anyway, when I run my application by java command line and set -Xmx = 256 then it ran well.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 92

Expert Comment

by:objects
ID: 9675083
> Physical memory is 1GBwhy Runtime.getRuntime().maxMemory()/1024 always return 131072?

Physical memory is not reltaed, the VM has it's own allocated memory space.
0
 

Author Comment

by:sontnvn
ID: 9675792
How can we force JVM increase its maxMemory size? (JWS environment)
When the application throw OutOfMemory exception, task manager (Win2k) report Mem Usage = ~110 000MB.
0
 
LVL 92

Expert Comment

by:objects
ID: 9675811
> How can we force JVM increase its maxMemory size?

That is supposedly what max-heap-size should be doing.

Can you post your complete jnlp file.
0
 

Author Comment

by:sontnvn
ID: 9676084
Below is our jnlp file

<?xml version="1.0" encoding="utf-8"?>

<jnlp spec="1.0+"
      codebase="http://napple/nApple"
      href="nApple.jnlp">
   <resources>
      <!--<j2se version="1.3+" initial-heap-size="128m" max-heap-size="256m"/> -->
      <j2se version="1.3+" initial-heap-size="64m"/>
      <j2se version="1.3+" max-heap-size="128m"/>
      <j2se version="1.3+" href="http://java.sun.com/products/autodl/j2se"/>
      <jar href="nApple.jar" main="true" download="eager"/>
   </resources>
   <application-desc main-class="com.ykgw.ees.ui.NApple">
         <argument>10</argument>
         <argument>1</argument>
         <argument>http://napple/nApple/nApple.wsdl</argument>
         <argument>http://tempuri.org/nApple/message/</argument>
         <argument>http://schemas.xmlsoap.org/soap/encoding/</argument>
      <argument>http://tempuri.org/nApple/action/PlanDispatcher</argument>
      <argument>50</argument>
   </application-desc>
</jnlp>

>That is supposedly what max-heap-size should be doing.
==> That mean we cannot change this value?
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 9676191
Try with only one j2se entry.
0
 
LVL 92

Expert Comment

by:objects
ID: 9676511
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now