pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4041) Memory Leak while converting pdf to images
Date Wed, 03 Jan 2018 17:12:00 GMT

    [ https://issues.apache.org/jira/browse/PDFBOX-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16309930#comment-16309930

Tilman Hausherr commented on PDFBOX-4041:

I ran your program and had it do a few loops without trouble in release mode with the trunk.
I set {{-Xmx250m -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true}}.
{{-Xmx250m}} is a pretty low value IMHO, I use {{-Xmx2g}} for my tests.

Maybe you had some troubles in your production environment, and then thought that what you
saw in profiling was the cause?

in my production environment the memory is not released for a very long time (some time hours)
Are you using some individual settings for the gc in production? What jdk are you using? I
am using 1.8.0_151 on windows 7.

> Memory Leak while converting pdf to images
> ------------------------------------------
>                 Key: PDFBOX-4041
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4041
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.7
>            Reporter: Ajit
>         Attachments: File2_5Mb.pdf, PDFBOX-4041_MemProfile.png, PDFConverter.java, heap.jpg,
> I am observing memory leak in PDF to images conversion simple program. I realise the
PDF that I am converting is bit bigger in size.
> Check the heap image and you will see that leak is happening even though I have flushed
the buffered image and set it to null explicitly. I have also closed the document too.
> !heap.jpg|thumbnail! If you notice the image, the process was running at 2 GBs in only
two runs. I am not able to attach the heap, because of its bigger size. But note the image
at the bottom and you will see that BufferedImage is taking about 500 MBs.
> I have also provided the source code (few lines) and hoping I haven't done any stupid
> * I have gone through getting started [https://pdfbox.apache.org/2.0/getting-started.html]
 and set -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
the options. It does not help much
> * Maven Dependencies - pdfbox-tools, jai-imageio-core, jai-imageio-jpeg2000, levigo-jbig2-imageio
> There are some debug messages related to ScratchBuffer, I searched about it and it seems
it is harmless. I came across the bug PDFBOX-3388. From the comments, It seems it is relevant
but harmless.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org

View raw message