I have created a component that contains an image. then, I make repeated calls to component.createImage. After 40 iterations, a test application gets an OutOfMemoryError within the java.awt.image class. How can I prevent the memory from begin eaten up by successive calls to createImage? I have tried image.flush() and Runtime.getRuntime().gc() but it didn't work. Any help would be appreciated.
posted 15 years ago
Hi, Try to increase the initial and maximum heap of the JVM. Try java -X on jdk to see more. Cheers, cata Lin.