Solved

Max-heap-size of JVM

Posted on 2003-11-02
12
2,014 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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
 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
varialbe initialization 11 32
null output 3 24
What's wrong with this code? 4 22
Adding multiple JVM environments to RedHat 6 7 19
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

776 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