Bug 689532

Summary: PDF file uses large amount of memory (2 gigs)
Product: Ghostscript Reporter: Marcos H. Woehrmann <marcos.woehrmann>
Component: PDF InterpreterAssignee: Default assignee <ghostpdl-bugs>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P2    
Version: master   
Hardware: Macintosh   
OS: MacOS X   
Customer: 190 Word Size: ---
Bug Depends on: 689492    
Bug Blocks:    
Attachments: leak_fix.patch

Description Marcos H. Woehrmann 2007-10-24 21:37:40 UTC
The customer reports and I've confirmed that the attached PDF file causes Ghostscript to use a large 
amount of memory when rendered at 300 DPI.  This happens with gs8.60 and gshead (r8317).  The 
customer reported 2 gigs of memory usage; my PowerBook core dumps after allocating 1.8 gigs.

The command line I used:

  bin/gs -sDEVICE=tiff24nc -sOutputFile=test.tif -r300 ./47540xtesthela.pdf
Comment 1 Marcos H. Woehrmann 2007-10-24 21:40:41 UTC
Created attachment 3498 [details]
47540xtesthela.pdf.gz
Comment 2 Ray Johnston 2007-10-25 08:40:56 UTC
This is probably a duplicate of bug 689492. Both trip over logic that results
in transparency buffers being leaked. Running non-banded mode, the GC will
locate and free these chunks, but when banding is used, the GC never runs during
the 'print_page' so the leaks accumulate.
Comment 3 Ralph Giles 2008-02-14 18:56:21 UTC
I now get "/undefined in G" with HEAD. Assigning back to support; maybe Alex
should take a look?
Comment 4 Ralph Giles 2008-02-14 19:10:14 UTC
Never mind, I missed that the attachment was compressed.
Comment 5 Henry Stiles 2008-04-01 08:51:54 UTC
reassigning to Leo to see if this bug should have been closed with 689492.
Comment 6 Ray Johnston 2008-04-17 10:52:45 UTC
Marcos will re-test
Comment 7 Marcos H. Woehrmann 2008-05-02 13:04:18 UTC
Memory usage for this file with gshead (r8693) is down to 743 megs.  
Comment 8 Ray Johnston 2008-05-06 11:55:12 UTC
With HEAD (rev 8700) this file completes in about 80Mb (adding
-dBufferSpace=32000000 to the options for speed). Note there is a brief spike of
memory usage up to about 160Mb (probably a duplicate of the SMask issue), but
the primary large leak is fixed.

Comment 9 Ray Johnston 2008-05-06 11:56:18 UTC
Created attachment 3987 [details]
leak_fix.patch


Attaching a patch for gs8.60 that fixes 8.60 to use the same amount of memory
as head. This patch also fixes the 'leak' issue with bug 689492 on 8.60