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

PDF: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space #147

Closed
Intelligent2013 opened this issue Aug 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Intelligent2013
Copy link
Contributor

Source issue: #129

Source document: https://github.com/metanorma/mn-samples-plateau/tree/main/sources/001-v4

The Java heap space is 3Gb (-Xmx3g):
java -Xss10m -Xmx3g -Djava.awt.headless=true -Duser.home=C:/Users/TestUser -jar C:/tools/ruby31/lib/ruby/gems/3.1.0/gems/mn2pdf-1.96/bin/mn2pdf.jar --xml-file "C:/Users/TestUser/AppData/Local/Temp/document20240820-14216-nqjje3.xml" --xsl-file "C:/tools/ruby31/lib/ruby/gems/3.1.0/gems/metanorma-plateau-0.1.3/lib/isodoc/plateau/plateau.international-standard.xsl" --pdf-file "D:/Work/Metanorma/repositories/mn-samples-plateau/sources/001-v4/document.pdf" --syntax-highlight --font-manifest "C:/Users/TestUser/AppData/Local/Temp/fontist_locations20240820-14216-xsjmpq.yml"

Output:

[mn2pdf] [INFO] Intermediate format. Rendered page #677.
[mn2pdf] [INFO] Intermediate format. Rendered page #678.
[mn2pdf] [INFO] Processing of Intermediate Format with information about the table's widths (table_if.xsl) ...
[mn2pdf] [INFO] Generated successfully!
[mn2pdf] [INFO] Generation XML with table's widths ...
[mn2pdf] [INFO] Generated successfully!
[mn2pdf] [INFO] XSL-FO file preparation...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Arrays.java:3664)
...
@Intelligent2013 Intelligent2013 added the bug Something isn't working label Aug 20, 2024
@Intelligent2013 Intelligent2013 self-assigned this Aug 20, 2024
@ronaldtse
Copy link
Contributor

@Intelligent2013 so this current branch/document is problematic because it is broken. The entire document body is treated as a single source code block. This is likely the cause of the problem.

I'm not sure if it's worth investigating or fixing.

@Intelligent2013
Copy link
Contributor Author

@ronaldtse yes, I sure that the issue occurs due the big sourcecode block. The reason in the file
mn-samples-plateau\sources\001-v4\sections\section-04\section-07.adoc - no ---- after the code block {% render 'gml_dict_template', root: root, filename: filename %}:

====== Waterway_function.xml

lutaml_gml_dictionary::iur/codelists/3.1/Waterway_function.xml[template="gml_dict_template.liquid",context=dict]
----
{% render 'gml_dict_template', root: root, filename: filename %}

====== WaterwayDetailAttribute_routeDirection.xml

I've tried to add ---- after the block:

----
{% render 'gml_dict_template', root: root, filename: filename %}
----

but now the errors occurs about the missing 001-v4/iur/codelists/3.1/Common_districtAndZonesType.xml:

C:/tools/ruby31/lib/ruby/gems/3.1.0/gems/metanorma-plugin-lutaml-0.7.6/lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_base.rb:31:in `read': No such file or directory @ rb_sysopen - D:/Work/Metanorma/repositories/mn-samples-plateau/sources/001-v4/iur/codelists/3.1/Common_districtAndZonesType.xml (Errno::ENOENT)

@Intelligent2013
Copy link
Contributor Author

I've found the updates in https://github.com/metanorma/mn-samples-plateau/pull/146/files already.
Closing.

@ronaldtse
Copy link
Contributor

Thanks @Intelligent2013 .

@ReesePlews
Copy link
Contributor

@Intelligent2013 and @ronaldtse thanks guys for working on this so promptly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants