Page 1 of 1

Huge image memory management

Posted: 2008-04-07T08:55:14-07:00
by Bob2
Hello,

I don't manage to open a 20000x20000 picture. I've tried to set the environment variables as described in the help, but that still doesn't work. (error : Cache ressource exhausted) I would like to set the variables so as the maximum used Ram memory is 100 Mb, the maximum MemoryMapFile memory is 1 Gb, and the max hard drive used is 10 Gb. To do this in my c code, is the following correct? :


SetMagickResourceLimit(AreaResource, 100000); //Size of Max Ram memory used in byte?
SetMagickResourceLimit(FileResource, 33000); //Max number of pixels in RAM so
// AreaResource/3 if I'm in 24 bit/pixels?
SetMagickResourceLimit(MemoryResource, 100000); //I don't see the difference with
//AreaResource?
SetMagickResourceLimit(MapResource, 1000000);//1 Gb in MemoryMapFile memory
SetMagickResourceLimit(DiskResource, 10000000); //Max 10 Gb on hard drive

What am I misunderstanding?

Thank you very much in advance.
Best regards.
Bob

Re: Huge image memory management

Posted: 2008-04-07T09:05:31-07:00
by magick
Try setting MAGICK_TMPDIR to a path that has plenty of free space to write the temporary pixel cache (> 10GB). Now run your application. Does it complete now?

Re: Huge image memory management

Posted: 2008-04-08T01:00:24-07:00
by Bob2
Hi Magick,
thanks a lot for your answer, but I don't manage to find the keyword to set that MAGICK_TMPDIR environment variable.. What code can I use to do that?

Thanks a lot in advance !
Bob

Re: Huge image memory management

Posted: 2008-04-08T02:47:19-07:00
by Bob2
I still haven't found out how to set the tmpDir variable, but I've located the default folder wich seems to be used, it's the standard windows temporary files folder (I work under windows). Indeed I've found files begining with magic... in this folder.
I've 7 Gigabytes free on this hard-drive.

For example when I use SampleImage() function, a temporary file is created, but what surprise me a lot, is that when I try to open a big image (like 1000x10000), there isn't any temporary file created... So I suppose I do a environment variable set error.. Do you have an idea?

Thanks a lot in advance
Bob