Max-heap-size of JVM

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"/>
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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mick BarryJava DeveloperCommented:
> The I couldnot start jws.

why not?
Mick BarryJava DeveloperCommented:
Also perhaps should be:

<j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

sontnvnAuthor Commented:
> <j2se version="1.3+" initial-heap-size="64m" max-heap-size="256m"/>
===> Nothing changed
Mick BarryJava DeveloperCommented:
> ===> Nothing changed

Can you explain exactly what is happening.
sontnvnAuthor Commented:
Case 1:
<j2se version="1.3+" initial-heap-size="64m"/>
<j2se version="1.3+" max-heap-size="256m"/>
<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.
Mick BarryJava DeveloperCommented:
> 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.
sontnvnAuthor Commented:
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.
Mick BarryJava DeveloperCommented:
> 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.
sontnvnAuthor Commented:
Below is our jnlp file

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

<jnlp spec="1.0+"
      <!--<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=""/>
      <jar href="nApple.jar" main="true" download="eager"/>
   <application-desc main-class="com.ykgw.ees.ui.NApple">

>That is supposedly what max-heap-size should be doing.
==> That mean we cannot change this value?
Mick BarryJava DeveloperCommented:
Try with only one j2se entry.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mick BarryJava DeveloperCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.