Bug 691397 - re-implement -K commandline option to limit memory usage
Summary: re-implement -K commandline option to limit memory usage
Status: NOTIFIED FIXED
Alias: None
Product: GhostPCL
Classification: Unclassified
Component: PCL interpreter (show other bugs)
Version: master
Hardware: PC Windows XP
: P4 normal
Assignee: Henry Stiles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 09:58 UTC by norbert.janssen
Modified: 2011-09-18 21:47 UTC (History)
0 users

See Also:
Customer: 661
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description norbert.janssen 2010-06-15 09:58:47 UTC
In Ghostpdl-8.70 the -K commandline option has been disabled. Please re-implement/enable it again. Our print-controller in which ghostpdl is used, requires this.
Comment 1 norbert.janssen 2010-06-15 09:59:16 UTC
see also 691374 and 691378.
Comment 2 Henry Stiles 2010-06-18 16:27:50 UTC
Added to rev. 11384.  There will likely be follow on bugs where return values aren't propagated correctly.  I am not sure if you (Norbert) want to add those to this bug or open new bugs.
Comment 3 norbert.janssen 2010-06-21 09:57:09 UTC
in plmain.c the 'K' option should have an #ifndef HEAP_ALLOCATOR_ONLY around it. Or use the old gs_malloc_wrapped_contents() (iff HEAP_ALLOCATOR_ONLY is defined).

#ifdef HEAP_ALLOCATOR_ONLY
    rawheap = (gs_malloc_memory_t *)gs_malloc_wrapped_contents(pmi->memory);
#else
    rawheap = (gs_malloc_memory_t *)gs_memory_chunk_target(pmi->memory)->non_gc_memory;
#endif
Comment 4 norbert.janssen 2010-06-22 06:43:30 UTC
If in hpgl a malloc (e.g. hpgl_clear_current_path()) fails, this is noted with the hpgl_call(), but hpgl_call() itself does not propagate the error (just 0). So further on when the path is accessed, ... crash.
Comment 5 Henry Stiles 2010-06-22 21:14:49 UTC
(In reply to comment #4)
> If in hpgl a malloc (e.g. hpgl_clear_current_path()) fails, this is noted with
> the hpgl_call(), but hpgl_call() itself does not propagate the error (just 0).
> So further on when the path is accessed, ... crash.

In debug mode the macro hpgl_call() calls hpgl_print_error() that prints a message and returns the error code, in production build it just returns the code.
Comment 6 Henry Stiles 2010-06-22 21:55:08 UTC
(In reply to comment #3)
> in plmain.c the 'K' option should have an #ifndef HEAP_ALLOCATOR_ONLY around
> it. Or use the old gs_malloc_wrapped_contents() (iff HEAP_ALLOCATOR_ONLY is
> defined).
> 
> #ifdef HEAP_ALLOCATOR_ONLY
>     rawheap = (gs_malloc_memory_t *)gs_malloc_wrapped_contents(pmi->memory);
> #else
>     rawheap = (gs_malloc_memory_t
> *)gs_memory_chunk_target(pmi->memory)->non_gc_memory;
> #endif


Added in revision 11421.
Comment 7 norbert.janssen 2010-07-01 09:36:25 UTC
-K is implemented, though I would like to have also a 'garbage-collection' mechanism that releases memory that was needed to print pages (intermediat buffers, rasterized characterbitmaps etc.) I.e. not the download resources (fonts/macros).
Comment 8 norbert.janssen 2010-07-01 09:37:48 UTC
(In reply to comment #7)
> -K is implemented, though I would like to have also a 'garbage-collection'
> mechanism that releases memory that was needed to print pages (intermediat
> buffers, rasterized characterbitmaps etc.) I.e. not the download resources
> (fonts/macros).

But I think this could be handled with 691378.
So this can also be closed.
Comment 9 Marcos H. Woehrmann 2011-09-18 21:47:10 UTC
Changing customer bugs that have been resolved more than a year ago to closed.