i wrote an application to create and to manage websites. The app also contains a module to generate and display galeries. I use threads to load each image and join them so that only one image will be loaded at the same time. The images are resized and displayed as thumbnails.
As long as the images are small (about 40 kBytes(.jpg-Format)) with an average size of 640 x 480 pixel with the default memory settings for the JVM, there are no problems no matter how large a galery is.
But when I use high res images with about 5 MBytes and an average size of 2400 x 1800 pixel or even higher, the load process of the galery crashes after the 10th to 20th picture even when I give the JVM a maximum memory between 512 MBytes and 2048 MBytes.
I create an instance of the image through a buffered image and create a scaled instance into an ImageIcon. After this I dispose the buffered image and set the buffered image to null and manually call the garbage collector afterwards. Due to the gc call the load time increased.
Has anybody a hint how to optimize the load process?
Currently I am not at my developer pc, when i get back to it I will post the loading routine to ease assistance.
Thanks and greetings,