2

I have a java app that loads an enormous data set into memory (don't ask - it's messy). This app runs fine in the IntelliJ debugger but gives OOM (out of memory errors) when I try to run it as a compiled .jar file.

How would I find out the params that IntelliJ is using to run it? Looking at the process list didn't reveal anything promising.

2 Answers 2

4

You can simply do something like this:

java -jar -Xmx2048m myJar.jar 

The xmx flag should allow you to add more memory for your jar to work with. You can just up this until it works.

Sign up to request clarification or add additional context in comments.

Comments

3

The first line in the Run toolwindow in IntelliJ IDEA shows the exact command line used to run the program, including all VM options.

5 Comments

This sounds spot on but Im not seeing it. "menu" / "run" (or "debug") / ?
If you're using the "Debug" button to run your application, switch to the Console tab in the debugger.
Wow - pages and pages of .jar files - and not an Xmx or similar in sight. Go figure.
There won't be a -Xmx if you didn't specify it in the "VM options" field of your run configuration.
Which I didn't.. which is why this is a tad mysterious. Oh well.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.