[python-win32] psyco win32com acrobat ole automation and memory
Baker, John D, ALABS
johnbaker at att.com
Wed Aug 4 19:26:57 CEST 2004
i put together a quick win32com script to walk through a pdf using
acrobat's ole automation & have odd memory usage when using psyco.
python 2.3.4 and acrobat 4 typelib.
With Psyco enabled and I ran this on a very large PDF (5000+ pages), the memory usage exploded to 400M+ before I killed it.
With Psyco Removed, memory use is constant at 6M or so.
Maybe this is normal, but it was a surprise to me.
JB
# abbreviated ...
o = win32com.client.Dispatch("acroexch.pddoc")
o.Open(os.path.abspath(f))
pages = o.GetNumPages
for p in range(pages):
page=o.AcquirePage(p) # Creates a COM object
textselect = page.CreateWordHilite(hlist) # Creates a COM object
# Do Some Stuff
del page
del textselect
o.Close
del o
More information about the Python-win32
mailing list