Configuring virtual memory from Java in Linux

1123755 pts.
Tags:
Java
Linux
Virtual memory
I've been trying to run a Java application through Linux but I'm running into a few issues. When I launch the application (using the maximum heap size), the tops application of 240 MB of virtual memory is allocated to the application. It's creating several issues with different software on the computer. I don't think I'll use the reserved virtual memory because I'll get an OutOfMemoryError. Would there be a way to configure the virtual memory that's in use (in the Java process) under Linux?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question:  

 
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.

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: