Jump to content

Out of memory on a 64-bit computer?

Recommended Posts

I read the sticky and I'm wondering if I can get this error on a 64-bit computer that's only a month old. I haven't even downloaded that much stuff. I'm using the 4.0 beta version, as I got the error on latest stable version as well. I'm opening a 22,720 kb PSD file using the PSD plugin (Photoshop.dll). The error is:

System.OutOfMemoryException: Insufficient memory to continue the execution of the program.

at PaintDotNet.Data.PhotoshopFileType.PsdLoad.CheckSufficientMemory(PsdFile psdFile)

at PaintDotNet.Data.PhotoshopFileType.PsdLoad.Load(Stream input)

at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\paintdotnet\src\Data\FileType.cs:line 459

at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\paintdotnet\src\Base\Functional\Func.cs:line 156


However, a 7,025 kb PSD file works fine.


Thanks for helping. :)

Edited by NutOfDeath
Link to comment
Share on other sites

As far as I remember the psd file plugin uses some logic to compare the physical amount of memory against the memory needed to open the file in Paint.NET. (CheckSufficientMemory method call in error message). The reason is quite simple.


The adress space of a 64bit processor is large enough but if the the physical ram is not large enough to take the expanded psd file in Paint.NET internal format then the processor has to swap memory in and out which will slow down your whole system. Paint.NET will be unresponsive in this time and you will not be able to work with the file after load.


The simplified formula to calculate the expanded size in memory is ((Number of layers + 2) * image width * image height * 4).

Each layer will be expanded to the full size of an image.


So the author decided to throw an out of memory error quite early instead of letting the user alone with an unresponsive system.

IMHO: A quite good decission.


The first thing you should do now is to calculate the expanded size and compare it with the physical ram. If you think there is enough physical ram compared to the expanded then you should contact the author. Maybe the CheckSufficientMemory logic is not correct.

midoras signature.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...