Not enough memory error: Word 2004

H

H.Tomaru

This problem seems classic. I searched the net but could not find the
solution.

I made an Applescript to batch edit many Word files.
The script is called from a shell script.
After several tens of files edited, every time at the same point, Word
refuses to launch saying "There is not enough memory or disk space to
run Word". (I use Japanese version and this is my own guess for the
message in English version.) This message occurs when Word tries to load
"Windows media installer".

This problem persists after removing preference directory for Microsoft.

After logout and login, however, Word launches again.
Removing all files in Temporary Items does not solve the problem.

Can anyone give me advice?
 
P

Paul Berkowitz

This problem seems classic. I searched the net but could not find the
solution.

I made an Applescript to batch edit many Word files.
The script is called from a shell script.
After several tens of files edited, every time at the same point, Word
refuses to launch saying "There is not enough memory or disk space to
run Word". (I use Japanese version and this is my own guess for the
message in English version.) This message occurs when Word tries to load
"Windows media installer".

This problem persists after removing preference directory for Microsoft.

After logout and login, however, Word launches again.
Removing all files in Temporary Items does not solve the problem.

Can anyone give me advice?

As a practical suggestion, why don't you just leave Word open? Then you
don't have to keep launching it.

"Every time at the same point"... at the same point of what?

Leave Activity Monitor open and keep track of free RAM (and inactive RAM).
Maybe there's a lot of memory leakage going on and the system really does
run out of memory - that's what it sounds like to me. Get the free :Memory
Stick" and see how many swap files are open at that point - if it's more
than one, you're in trouble and running out of RAM and soon - out of disk
space for virtual RAM. Logging out and in frees up all the RAM again.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
H

H.Tomaru

Paul, thank you for your advice.

Paul said:
As a practical suggestion, why don't you just leave Word open? Then you
don't have to keep launching it.

Keeping Word open worsens the problem: Word refuses to save documents after
several save operations.
My earlier applescript got this error and I decided to kill Word for
every several editing jobs.
Since I don't know how to quit Word in Applescript, I execute killall
command.
(Word's Applescript command "save as" does not seem to work and I use
"do Visual Basic" to save documents instead.)
"Every time at the same point"... at the same point of what?

At the same point of my shell script, which means after the same number
of editing jobs.
Leave Activity Monitor open and keep track of free RAM (and inactive RAM).
Maybe there's a lot of memory leakage going on and the system really does
run out of memory - that's what it sounds like to me. Get the free :Memory

Stick" and see how many swap files are open at that point - if it's more
than one, you're in trouble and running out of RAM and soon - out of disk


I also suspected memory leakage.
My Mac has 1GB memory and the Activity Monitor reported about 512MB was
free when Word refused to start. The amount of inactive RAM was about 256MB.
This did not seem memory leakage and I began to suspect Word.
space for virtual RAM. Logging out and in frees up all the RAM again.


I will check again for memory leakage. I will check if the situation
changes when an application that uses a lot memory such as VirtualPC is
running simultaneously.
 
P

Paul Berkowitz

Keeping Word open worsens the problem: Word refuses to save documents after
several save operations.

That doesn't sound right. Do you have the preference to "Allow fast saves"
on? You must never do that - it's a terrible "feature" (bug). Turn it off.
If it is off, I don't know why Word would be refusing to save documents, but
John McGhie might.
My earlier applescript got this error and I decided to kill Word for
every several editing jobs.
Since I don't know how to quit Word in Applescript, I execute killall
command.

????

tell application "Microsoft Word"
quit
end tell

Of course, that's the normal quit that asks if you want to save each unsaved
document. So first you have to save and close each document (or close saving
yes, or close saving no. Sometimes the best technique is to save, then close
saving no.)
(Word's Applescript command "save as" does not seem to work and I use
"do Visual Basic" to save documents instead.)

Word 2004's 'save as' works perfectly fine. Maybe you need some help with
the syntax.


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
H

H.Tomaru

Paul said:
That doesn't sound right. Do you have the preference to "Allow fast saves"
on? You must never do that - it's a terrible "feature" (bug). Turn it off.
If it is off, I don't know why Word would be refusing to save documents, but
John McGhie might.


I turn all save options except "automatic backup" off.
Word allows several save operations, but it begins to complain "not
enough memory or disk space"
(again, my own translation from Japanese message) and refuses to save
further documents.

????

tell application "Microsoft Word"
quit
end tell

Of course, that's the normal quit that asks if you want to save each unsaved
document. So first you have to save and close each document (or close saving
yes, or close saving no. Sometimes the best technique is to save, then close
saving no.)



It works now... A couple of days ago, the Script Editor refused to
save the script
if "quit" command exists before "end tell". Maybe it's a bug of the
Script Editor.
Word 2004's 'save as' works perfectly fine. Maybe you need some help with
the syntax.


A couple of days ago,  I got an error message saying '"save as" does
not understand ....'
It works now for the uncommented same script:
save as newDoc file name pbFileName

I changed my applescript to use "quit" and not to use "do Visual Basic"
and "killall".
As a result, my script seems to have completed first hundreds of editing
jobs.
It leaved several Word's error message "Microsoft Word has encountered a
problem and needs to close."
But my shell script, which checks the existence of saved file, does not
report errors.
I will have to check if the resulting files are correct when this
message is displayed.
The Activity Monitor reported increasing inactive memory that amounted
to 400MB at the completion of my script. Free memory was 40MB out of 1GB!

Again, I appreciate your help. Thank you, Paul.
 
J

John McGhie [MVP - Word and Word Macintosh]

Paul:

I think he may be running out of File Handles.

Each time he opens, edits, and saves a document, Word will keep a link to
the temporary files it created for that document open in case he decides to
paste the text anywhere. After a few of those, the OS won't give Word any
more file handles.

It may be that Word is appending changes to Normal template.

The user could end the document procedure with:

With Activedocument
.undoclear
.SaveAll
End with

That might solve both problems

Could it be that AppleScript is preventing the OS from releasing the files
and memory from the closed documents?

Could it be possible that there's been a change to AppleScript that causes
Word to be launched as a child of AppleScript? So that memory garbage
collection and file handle release would then not happen until the outer
AppleScript process exits?

Cheers

That doesn't sound right. Do you have the preference to "Allow fast saves"
on? You must never do that - it's a terrible "feature" (bug). Turn it off.
If it is off, I don't know why Word would be refusing to save documents, but
John McGhie might.


????

tell application "Microsoft Word"
quit
end tell

Of course, that's the normal quit that asks if you want to save each unsaved
document. So first you have to save and close each document (or close saving
yes, or close saving no. Sometimes the best technique is to save, then close
saving no.)


Word 2004's 'save as' works perfectly fine. Maybe you need some help with
the syntax.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
A

Adam

I am having a similar problem with Word 2004 on a new 15" PowerBook
running Tiger, and it was not resolved by upgrading to Word Version
11.1.1. I would appreciate any thoughts on how to fix it. When you
try to quit the application with a document open (even if you have just
saved any changes to the document), a message appears stating, "The
disk is full. Free some space on this drive, or save the document on
another disk. Try one or more of the following: * Close any unneeded
documents, programs and windows. * Save the document on another disk."
Of course, there is tons of room on this machine to save the document
and I'm only running one or two other apps. Continuing to try to quit
Windows results in a dialogue box which asks if I want to save changes
in my Normal template. Any thoughts? This is a major impediment to
using Word!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top