BlackBerry OutOfMemoryError
I am getting an OutOfMemoryError. How do I solve this?
Error: java.la开发者_StackOverflow中文版ng.OutOfMemoryError: Java heap space
You need to either increase the available heap space (with the Java -Xmx
flag) or use less memory in your application.
I'd recommend that you try to use less memory. There are plenty of good profiling tools out there that you can use to discover where your code uses a lot of memory. It's also worth checking that you are not misusing any HashMap
s or ObjectOutputStream
s. Those two classes are notorious for soaking up memory if not used properly.
精彩评论