Linux Java application is using too much virtual memory

1136875 pts.
Tags:
Java
Linux
Virtual memory
In Linux, I have a Java application that's running. When the application starts up, it uses the maximum size (64 MB). And I have 240 MB of my virtual machine allocated to this application. But when I reach the heap limit, I keep getting an Out of memory error message. I have ran this same app in Windows and haven't gotten a problem. What can I do here?Jav
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    What Windows OS? Which Linux distro? Especially, in both cases, what JVM is used?
    34,400 pointsBadges:
    report
  • ToddN2000
    Provide the versions and configurations you're using and we can give a better answer.
    131,440 pointsBadges:
    report
  • TheRealRaven
    It might be surprising if clarification comes. Almost the exact same question was asked a Stack Exchange site some six years ago. Looks like someone just copied the question with paraphrasing to here. A question like this that's so old for Java is probably useless, and getting details would be unlikely.
    34,400 pointsBadges:
    report
  • TheRealRaven
    Yep, that's the one.
    34,400 pointsBadges:
    report
  • Elizine

    Try using the -Xms and -Xmx options when running your program, which define the initial and maximum size for the program respectively.

    Example: -Xmx1G (allocates 1GB of RAM maximum) .
    1,145 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: