I’m creating a Java application for image processing , and after a while of working on this program I got Out of memory exception because I think the Image objects taking a lot of memory space ,I can save the images as files to hard disk and read them when i need but that may took milli-seconds vs Nano-seconds if I use RAM with object.what I can do to solve this?
Share
First of all, use a memory profiler such as
YourKitto figure out what it is exactly that’s consuming the memory (for example, it could be due to the accidental retention of some unneeded references). Once you understand how your program is actually using the memory, you can formulate a plan of attack.