ManticMoo.COM All Articles Jeff's Articles
Jeffrey P. Bigham

Exception in thread

Jeffrey P. Bigham

Related Ads

Sometimes your java applications simply need more memory. And, sure, maybe you could (and should) spend a ton of time debugging and optimizing them so they don't require that much memory, but sometimes you just want to see if it works and, others, you really need more memory. There's a simple command you can set to do this. Simply call your java command with an argument of the following form:


-Xmx150M

That will run your program allowing it a maximum of 150 Megabytes of memory. If your program needs this much and you deny it, then you'll see an error like this once your program runs out of memory:


Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Jeffrey P. Bigham
ManticMoo.COM All Articles Jeff's Articles