You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2023/06/28 03:16:00 UTC

[jira] [Comment Edited] (PDFBOX-5626) java.lang.OutOfMemoryError: Java heap space

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

Tilman Hausherr edited comment on PDFBOX-5626 at 6/28/23 3:15 AM:
------------------------------------------------------------------

This time your screenshot is really about the JPEG2000 decoder. This isn't part of PDFBox. The source code is available, obviously, but it isn't maintained anymore. The last change is from 3 years ago
https://github.com/jai-imageio/jai-imageio-jpeg2000/
even before it took several years to commit and release a change that fixed a widespread problem. (The inkl-blot problem; and the fix is still incomplete)


was (Author: tilman):
This time your screenshot is really about the JPEG2000 decoder. This isn't part of PDFBox. The source code is available, obviously, but it isn't maintained anymore. The last change is from 3 years ago
https://github.com/jai-imageio/jai-imageio-jpeg2000/
even before it took several years to commit and release a change that fixed a widespread problem. (And the fix is still incomplete)

> java.lang.OutOfMemoryError: Java heap space
> -------------------------------------------
>
>                 Key: PDFBOX-5626
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5626
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.28
>            Reporter: liu
>            Priority: Major
>         Attachments: image2.pdf, screenshot-1.png, screenshot-2.png, screenshot-3.png, screenshot-4.png, screenshot-5.png
>
>
> jvm:-Xmx600m
> demo:
> {code:java}
> public static void main(String[] args) throws IOException, InterruptedException {
> 		File file = new File("D:\\test\\image2.pdf");
> 		final PDDocument load = PDDocument.load(file, MemoryUsageSetting.setupTempFileOnly());
> 		PDFRenderer renderer = new PDFRenderer(load);
> 		int pageIndex = 0;
> 		float scale = 0.5f;
> 		try {
> 			BufferedImage bufferedImage = renderer.renderImage(pageIndex, scale, ImageType.RGB);
> 			FileOutputStream fos = null;
> 			try {
> 				fos = new FileOutputStream(new File("D:\\fcs\\test/test6/image" + pageIndex + ".jpg"));
> 				ImageIO.write(bufferedImage, "jpg", fos);
> 			} finally {
> 				if (fos != null) {
> 					fos.close();
> 				}
> 			}
> 		} catch (Exception e) {
> 			System.out.println(e);
> 		}
> 	}
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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