Jump to content

High memory usage?


NigelTufnel

Recommended Posts

I'm creating a banner for my band. The specs on the image that the printer would like are 100dpi jpeg at actual output size. So the banner is going to be 3' x 6'.

What I did was create a new PDN at 100dpi, 72" by 36". Now granted, this is going to take up some memory. But here's where it gets interesting. The project consists of 2 layers, one of some pretty simple text, and another with a black background and an image. The PDN itself is about 15MB on disk.

But the memory used by the PDN application while it is loaded is well over 1GB. Since I don't have an analogous program like PhotoShop installed on my computer, I can't see if this is a normal expectation or not.

Adding a third layer results in a message stating that there was "not enough memory to complete the operation". Both machines I have tried this on have 1GB or physical memory and a 1GB swap file. Granted, that isn't a lot by today's standards. I'm just curious if it is normal to expect PDN to take up over 1GB of RAM while a 15MB PDN file is loaded.

PDNSig020208.jpg
Link to comment
Share on other sites

PDN lacks sophisticated memory manager that would use both hard drive and memory to manage the image, instead it just dumps everything in the memory.

If I remember the formula right... (height * width * argb (32 bits/pixel)) * (n+1) n == number of layers, +1 for scratch..

So, ((72" * 100dpi) * (32" * 100dpi) * 32 bits -> 4 bytes) * (2 layers + 1 scratch) = 311 megs of memory? not 2.5 gigs...

I pulled this from nothing so it can't be right...? I forgot bits and bytes... :|

I'm outside localization... omg

sig.jpg.7f312affa740bae49243c4439bc4a244.jpg

Link to comment
Share on other sites

Sure, Rick. I understand that. I just wanted to know if that was an expected memory usage for that size of graphic. Looks like it is. Thanks for answering.

PDNSig020208.jpg
Link to comment
Share on other sites

Wouldn't page caching eliminate that problem?

mastzg2.png

100% paint.net

One sad attempt at a sig, but it's all about the intellectual property rights anyways.

Link to comment
Share on other sites

Wouldn't page caching eliminate that problem?

By that I assume you mean utilizing the hard drive as well as memory. Yes and no. The hard drive has much more available space, but the memory is still much faster.

Link to comment
Share on other sites

Forgive me for asking this, but how well does PhotoShop or other graphics software handle memory differently from PDN? I'm not complaining. It's my fault that my computer only has so much RAM, and it is due for an upgrade. I'm just curious.

By the way, I love PDN. Probably the best piece of free software I "own". :D

PDNSig020208.jpg
Link to comment
Share on other sites

Forgive me for asking this, but how well does PhotoShop or other graphics software handle memory differently from PDN? I'm not complaining. It's my fault that my computer only has so much RAM, and it is due for an upgrade. I'm just curious.

By the way, I love PDN. Probably the best piece of free software I "own". :D

Photoshop, in my experience, is a notorious memory hog.

Link to comment
Share on other sites

OHHH Yeah it is. HUGE memory hog. And it doesn't always give it all back right away, either...

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Forgive me for asking this, but how well does PhotoShop or other graphics software handle memory differently from PDN? I'm not complaining. It's my fault that my computer only has so much RAM, and it is due for an upgrade. I'm just curious.

The difference is that Paint.NET allocates the entire image into 1 big memory block, whereas other software breaks it down into smaller "tiles", e.g. 64 x 64 pixels.

With a tiled memory system it's much easier to scale down in a low-memory situation, and also to perform other compression-style tricks. For example, let's say you create a new layer. Let's say that the tile manager has special knowledge that all of those tiles are going to be exactly the same. In fact, it knows they contain all zero's. So it won't even allocate any memory for that -- it will just respond to requests by filling a tile with all zeros and handing it back to what requested it. It only starts allocating memory when something writes back non-zero pixels into any given tile.

Paint.NET doesn't use tiling, and so if there isn't enough memory for an entire layer -- or even enough contiguous virtual address space in the current process -- then the whole thing fails.

For v4.0 I am planning to move towards a tile-based system, for many reasons.

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

For v4.0 I am planning to move towards a tile-based system, for many reasons.

That's fantastic, Rick. Sounds like you're going to have your work cut out for you. Thanks for answering that.

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

×
×
  • Create New...