2

I tend to have Matlab open all the time, just in case I need to do some quick calculations. But recently I've been programming in Java, and with uncanny consistency, if I run my Java application off and on for an hour or so (as one tends to do when debugging), then Matlab throws some error and becomes unresponsive.

The error tends to be a Java out of memory error, but I've seen other, more exotic errors thrown as well.

This this a normal/known thing? Either way, is there some way I might prevent my Java work from interfering with my Matlab instance?

Note that this isn't even unique to my Java applications, pretty much all Java apps I download eventually cause the same problems.

1 Answer 1

3
+50

Increase the Java heap size in MATLAB so that MATLAB doesn’t crash.

Works cited: http://blogs.mathworks.com/community/2010/04/26/controlling-the-java-heap-size/

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

3 Comments

Does Java share its heap between applications?
The JVM heap is shared for all Java objects. mathworks.com/support/solutions/en/data/1-19NKK/…
So no, Java does not share its heap between applications, but applications that use Java share a common heap. Does that distinction make sense. I’d increase your Java heap size to 1/4 of your installed RAM. This is what everyone always recommends. I had a similar problem a few months ago, and when I increased my JVM, this problem went away, too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.