Mitchell Holmans

Greenhorn
+ Follow
since Jan 07, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mitchell Holmans

It will be for iPhone, Android and PC but the initial PC implementation is being used to figure out how the program will work and how to deal with large images and small amounts of memory.
11 years ago
Hi all,

I'm currently working on an app that requires me to draw two large images (15MP) which can be zoomed, panned and resized. It works fine but the images total 500MB but it uses up 3.5GB of memory, which is fine on pc for what i need it for but will probably not work too well on a mobile device. At the moment, the code loads the two BufferedImages and then draws them as necessary within a viewport on the screen. I am aware that swing essentially keeps two copies of the BufferedImage, the normal one that was loaded (in raw uncompressed format) and a second copy which is essentially what gets drawn to the screen.

So, my question is this, is there a way for me to optimize this process? As in, make it so that it does not use up enormous amounts of memory. So far i've tried using ImageReaders to subsample the image and only load in as needed but i'm sort of fumbling in the dark and it still seems to use up massive amounts of memory. If necessary i'll need to swap to another programming language (most likely C++) but i'd rather keep it in java so if anyone has any ideas, it would be very much appreciated.
11 years ago