Jump to content

Crash while converting .PDN to .JPG


Recommended Posts

GD,

While saving a (rather large) .PDN file to .JPG, I get an errormessage. See log below. This error happens consequently.

BTW: Nice program, easy to work with!

Crash log for Paint.NET v2.5 (Beta 4 Release build 2.5.2115.35521)

Time of crash: 18-10-2005 07:51:25

OS version: 5.0.2195.0

.NET Framework version: 1.1.4322.573

Exception details:

System.NullReferenceException: Object reference not set to an instance of an object.

at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)

at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)

at System.Windows.Forms.Control.Invoke(Delegate method)

at PaintDotNet.SaveConfigDialog.FileSizeTimerCallback(Object state)

------------------------------------------------------------------------------

Link to comment
Share on other sites

addition:

on the machines with 768MB Ram, I noticed that about 1 GB (!) of memory (std swap file of 2 GB) was used while opening the PDN file.

Conversion from PDN to JPG did not use that much memory.

the PDN file contains 10 or 12 layers, this may be the reason that this much (too much?) memory is used. the PDN file is only 20MB on harddrive though.

Link to comment
Share on other sites

Yeah, it sounds like an out of memory problem. We compress the image as we save it, but that does not necessarily correspond to how much memory it takes up.

To calculate the memory used, use the following formula:

memory usage = (layers + 2) x width x height x 4 bytes

In this case, (12 + 2) x 3000 x 4000 x 4 = 672,000,000, or about 641 MB of memory. That doesn't leave much for the Save Configuration dialog to do its job. Paint.NET has a different memory usage architecture than many other non-trivial image editing applications, one which was designed for engineering simplicity.

The solution? Well, more memory might help, but it probably won't. The real problem lies in a lack of virtual address space, which a 32-bit system will only give you 2 GB worth no matter what. The 64-bit release of Paint.NET, scheduled for mid-January, will give it access to a much larger virtual address space (terabytes worth). That of course assumes you have a 64-bit processor and a 64-bit operating system (Windows XP x64).

And no, this isn't a conspiracy to get people to upgrade to 64-bit Windows :) Paint.NET was just written in a certain way and changing it would require rewriting almost all of the application.

Anyway hopefully that explains things for you.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

It's not necessarily that you're running out of physical memory, but that there isn't a big enough hole in the 2 GB virtual address space for Paint.NET to do its job. Heck, I have a system with 2 GB physical + 4 GB pagefile, and it easily runs "out of memory" way before it hits 6 GB.

Virtual memory management is rather complicated and a full discussion is way way way beyond the scope of a forum thread post like this. Suffice it to say that your system could have 128 MB or 8 GB of memory, but each process (on 32-bit Windows!) would still only be able to to "see" up to 2 GB each. Notice that I use the word "each." It's very possible on an 8 GB system running 32-bit Windows that you could have 8 processes each with 1 GB allocated and all fitting within physical memory. Each process gets its own private virtual address space, and the details and intricacies of how this works are not really fully understood even by a lot of developers :)

If you want a full explanation, you might check out the Windows Internals book (or tome!) by Mark Russinovich and David Solomon, http://www.amazon.com/exec/obidos/tg/de ... s&n=507846

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

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.

Guest
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.

 Share

×
×
  • Create New...