Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutOfMemoryError: gc overhead limit exceeded #226

Open
dsp85103 opened this issue Mar 16, 2021 · 2 comments
Open

OutOfMemoryError: gc overhead limit exceeded #226

dsp85103 opened this issue Mar 16, 2021 · 2 comments
Labels
feedback Pending feedback

Comments

@dsp85103
Copy link

When I generate a big pdf (it's a report, about 150,000~200,000 row data)
Because I need to add statistics data, so I create Row & Cell by manual to custom my report

But I creating Row & Cell before drawtable, the ram direct up to ~3G from 400MB
then I call draw(), Java throws the OutOfMemoryError exception...
My JVM only setting 4G available memory..

Any one know how to improve this issue?
Thanks

btw. I am not english native speaker ;) Maybe some semantics wrong ...

@dsp85103
Copy link
Author

here is my create row and cell example code
`
Row row = baseTable.createRow(10.f);
Cell cell;
cell = row.createCell(contentColWidth.get("name1"), df.format(totalModel.getName1()), HorizontalAlignment.CENTER, VerticalAlignment.MIDDLE);
cell.setFont(font);
cell.setFontSize(fontSize);

DecimalFormat df = new DecimalFormat(",###");

cell = row.createCell(contentColWidth.get("val1"), df.format(totalModel.getValue1()), HorizontalAlignment.RIGHT, VerticalAlignment.MIDDLE);
cell.setFont(font);
cell.setFontSize(fontSize);

cell = row.createCell(contentColWidth.get("val2"), df.format(totalModel.getValue2()), HorizontalAlignment.RIGHT, VerticalAlignment.MIDDLE);
cell.setFont(font);
cell.setFontSize(fontSize);

cell = row.createCell(contentColWidth.get("val3"), df.format(totalModel.getValue3()), HorizontalAlignment.RIGHT, VerticalAlignment.MIDDLE);
cell.setFont(font);
cell.setFontSize(fontSize);

cell = row.createCell(contentColWidth.get("val4"), df.format(totalModel.getValue4()), HorizontalAlignment.RIGHT, VerticalAlignment.MIDDLE);
cell.setFont(font);
cell.setFontSize(fontSize);

... one row about have 20 column
`

And I use MAT tool to analyze the mem dump
I got this
https://i.imgur.com/xBjkGpC.png
this package use a lot of object cause mem full

@johnmanko
Copy link
Collaborator

@dsp85103 Can you provide a sample project?

@johnmanko johnmanko added the feedback Pending feedback label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback Pending feedback
Projects
None yet
Development

No branches or pull requests

2 participants