Memory leak – batch process related. Help!

R
Posted By
rpmBrian
Jul 27, 2006
Views
1695
Replies
17
Status
Closed
I searched the forums and read about the font preview memory leak, so I turned off my font previews. I never had a problem with a leak at idle anyway, only when I do a batch process with lots of files.

I have an action that I run to size down the images and put a watermark in the middle of it using verdana font. The problem is that I can only get about 700 files done then it runs out of ram with the error:

"Could not perform the request because there is not enough RAM."

The problem appears to be that photoshop is not releasing ALL the ram associated with the file that was closed before opening the next one.

Any suggestions to allow me to batch process all my files (~3000-4000 files)?

I am using CS2 with the latest updates, 2GB of ram and about 4GB virtual memory. I have photoshop set to use 80% of system ram. Thank you for any help you all can give!

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Y
YrbkMgr
Jul 27, 2006
Odd. I run batch processes on thousands of images per day, every day, and have never gotten the message. What is the percentage of ram allocated to photoshop set at in your preferences?
L
LenHewitt
Jul 27, 2006
Briuan,

The problem appears to be that photoshop is not releasing ALL the ram
associated with the file that was closed before opening the next one.<<

That’s the way Photoshop is meant to work – releasing and re-allocating memory is a time-consuming process. Photoshop only releases it on closing the application, but that doesn’t mean it can’t re-use it! It can and does.
R
rpmBrian
Jul 27, 2006
YrbkMgr:

Percentage of ram is 80%. This problem is duplicated on two of my machines, both running XP. I am running 8.2 megapixel images through it (roughly 3500×2300). I can sit there and watch the RAM of photoshop in the processes tab in task manager just climb and climb with each image opened. It goes down a little bit in between each image, but it’s march upward is never ending.

Is there a cleaner way to resize and watermark images with a 60% opaque font than a standard action? The web album makes the font solid with no drop shadow, which means it’s really distracting.

To help me get a base of knowledge, What sort of processes do you do on what size images?

Thanks,
-brian
CC
Chris_Cox
Jul 27, 2006
If it were a true leak, it would continue past the limit you set and crash.

If it just increases to the limit you set – that is perfectly normal.
R
rpmBrian
Jul 27, 2006
If it were a true leak, it would continue past the limit you set and
crash.

If it just increases to the limit you set – that is perfectly normal.

Perhaps my nomenclature is wrong, I am not a programmer. I guess it is just bad memory management?? Is it perfectly normal to run out of memory running a batch process on a machine with 2GB of ram when at any given time there is only 1 image open in photoshop ?

I’m convinced what photoshop is doing is not normal, but I can’t tell if its a problem/quirk in photoshop or something on my machine or the way I have my batch set up.
CC
Chris_Cox
Jul 27, 2006
WHAT is running out of memory?
What command or filter?

What you have described is normal, and is good memory management.

But running out of memory is not normal, UNLESS you are using certain filters that need a LOT of RAM.
R
rpmBrian
Jul 28, 2006
Photoshop runs out of memory with error: "Could not perform the request because there is not enough RAM." or something similar like "Could not initialize text engine."

This happens when I use the Automate function inside Photoshop to run a batch process of an action on a bunch of jpegs (qty ~4000) that are about 3500×2300.

The action is as follows:
1. Sizes the image to 500 pixels wide
2. Make text layer (my copyright)
3. Add an outer glow to the text layer
4. Set the text layer to 60% visibilty
5. Run a script that saves the file on top of itself **
6. Close

* * – The script is a modified version of "Save as JPEG" that I believe ships with photoshop.

Regardless, the problem still occurs even when I don’t call that script. The "problem" being that Photoshop continues to use ever more RAM for each file that it opens so that obviously and eventually it uses all available RAM and I get the error message that says there is not enough RAM after about 500 or 700 images processed.
CC
Chris_Cox
Jul 28, 2006
What command were you using when it says it ran out of memory (that is usually in the error message)? (Outer glow is my guess)

The only known memory leak in Photoshop CS2 is due to corrupt fonts, and that was fixed in 9.0.1.

Photoshop does use RAM up to the limit you set in preferences, not all available RAM. That is not a problem, that is by design. But that has nothing to do with getting an out of RAM message. Nor does it "obviously" use up more memory with each file, because Photoshop reuses the RAM that it has allocated. Please just describe the problem that you are seeing. Your bad guesswork is getting in the way of understanding the problem….
R
rpmBrian
Jul 28, 2006
I am not sure how much more I can describe the situation… but I will try… it seems to happen at different steps at different times if I recall correctly. But the last two times it gave me the out of ram error right after opening the file before it resized it.

One time I manually minimized Photoshop every couple hundred files or so and Photoshop’s RAM usage would drop from about 600MB to about 150MB. It would then repeat it’s climb and I would repeat the process. Eventually Photoshop gave an error anyway even though Task Manager said Photoshop was only using about 300MB. I don’t recall if the error was the "Could not initialize text engine" or the more common "not enough RAM". I have no idea if that was helpful, but I’m throwing it out there anyway.

All I’m saying is that if Photoshop’s RAM usage continues to grow, eventually it will hit a ceiling. I don’t know WHY or HOW it’s continuing to grow and that is what I’m trying to figure out. It APPEARS to grow each time a new file is opened or perhaps when the action is run.
PC
Pierre_Courtejoie
Jul 28, 2006
rpmBrian, have you tried running the whole batch operation with Photoshop minimized?
LL
Larry_Ligon
Jul 28, 2006
Open up your Preferences dialog.
On the General page . Un-check the box next to Export Clipboard. Set the History states to 1. Un-check the box next to History
Log.

Go to Plugins/Scratch Disks page.
Set the Scratch Disks to use a different physical drive for each one.

For example I have:

First: Startup
Second: F:\

Go to Memory & Image Cache page. Set the Cache Levels to 1.

Close Photoshop and the re-open and run your batch.

If you have your scratch disks set up to use several physical drives for the scratch disks and you still get an out of memory error,
you have probably found a bug in Photoshop. Even though you’re using all your physical memory, Photoshop should not run out of
memory because it uses the scratch disks to create and use virtual memory. You should only get an out of memory message when all
your scratch disks are full.

Larry
FD
false_dmitrii
Jul 28, 2006
A couple of other stabs at things to try:

Resize a test image to be much, much larger and duplicate it a bunch of times. Then run your batch process on the new files and see if the error happens any sooner.

If the error takes just as many files as before, see what happens if you perform the action steps manually. Do you run out of memory at the same rate? Or break out a portion of the action, then batch process with only the breakout portion. See if you can reduce the number of steps necessary to cause the problem.

If the error happens faster with larger files, use the larger files while testing manually to save yourself some time.
D
deebs
Jul 28, 2006
Would there be any incremental handicap to the scratch disk if Photoshop crashed a few times?

Maybe: move the scratch disk > close Photoshop > restart Photoshop > observe reading of new scratch disk > observe reading of old scratch disk > delete old scratch disk?
R
rpmBrian
Jul 28, 2006
rpmBrian, have you tried running the whole batch operation with Photoshop
minimized?

It won’t stay minimized unfortunately, it keeps coming back with each image it opens.

Would there be any incremental handicap to the scratch disk if Photoshop
crashed a few times?

Photoshop doesn’t crash, it just throws up an error box… which is definetely better than crashing, so I don’t think there is any scratch disk issues (I have it set to use two different hard drives).

Open up your Preferences dialog. On the General page . Un-check the
box next to Export Clipboard. Set the History states to 1. Un-check the box next to History Log.

Larry, your suggestions helped… ALOT! I didn’t give it a truely fair test this time since I am working on other stuff while photoshop runs in the background. Even with me working though it got 94% of the way through the files, which is a VAST improvement!! It eventually died when creating the text layer after resizing. I realized I had it wrong on my last post when I said it gave the error at resizing, it seems to always give the error at text creation time which is after resizing.

I will perform another test when I have the chance, but am headed out of town for a few days. I will report back my findings.

Thank you all so far for your help, especially Larry! It’s pointed me in directions I never thought to go.
LL
Larry_Ligon
Jul 29, 2006
So, you’re always resized the image to 500 pixels. Instead of creating a new text layer every time you can have a reference file
open with the text layer already made with style and layer opacity set to 60%. I have already worked on a JavaScript script to do
this for someone else. I could write you a script that will replace this part of the action. That way you won’t have to create the
text layer every time.

Larry
LL
Larry_Ligon
Jul 29, 2006
Are your target images various widths and heights?

Larry
FN
Fred_Nirque
Jul 30, 2006
No-one suggested the time honoured first-try fix for this yet? – Reduce your RAM allocation in prefs to 55% or less. Also, you may want to allocate more scratch disk space.

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

Related Discussion Topics

Nice and short text about related topics in discussion sections