Solved

Max-heap-size of JVM

Posted on 2003-11-02
12
2,013 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Groovy:unable to resolve class error 2 70
starter POM and spring-boot-starter,  spring-boot-web 2 43
eclipse argument 14 53
object oriented programming comparison 5 55
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

895 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

13 Experts available now in Live!

Get 1:1 Help Now