[GWT] Java heap exception during compilation
See original GitHub issueIssue details
It’s not possible to have big assets in the assets folder for html. GWT throws a Java heap exception during compilation.
@mgsx-dev was very kind and found the problem, it is happening during md5 calculation, specifically this line: https://github.com/libgdx/libgdx/blob/665f920902e543856fdd7d496f6ec422affd46d1/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/PreloaderBundleGenerator.java#L170
Reproduction steps/code
Create a libGDX project and add a huge asset to the assets folder (I tried with a 300MB gltf file with 4k textures) and run ./gradlew html:dist
Version of libGDX and/or relevant dependency
1.10.0 and probably older versions too
Please select the affected platforms
- Android
- iOS
- HTML/GWT
- Windows
- Linux
- macOS
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Out of Memory Error During GWT compilation - Google Groups
I am using GWT in my application. My system is having 2GB RAM and I have around 2000 Java files to compile. During...
Read more >GWT 2.5.1 Compile always throws Java Heap Space Error
Whenever I compile GWT 2.5.1 application. by right click on project and doing Run As-> Web Application (GWT Super Dev Mode), it never...
Read more >FAQ - Troubleshooting - [GWT] -
OutOfMemoryError: Java heap space. When compiling a project in GWT 1.5 or later, you may encounter problems with running out of memory. Compiling...
Read more >Compile / Unit Test error (java.lang.OutOfMemoryError
[gwt.javac] Consult the following stack trace for details. [gwt.javac] java.lang.OutOfMemoryError: Java heap space [gwt.javac] at com.sun.tools.javac.comp.
Read more >GWT Compiler Is Running Out of Memory - Ted Vinke's Blog
Add some permgen space, which is used when GWT compiles Java into Javascript. E.g. -XX:MaxPermSize=1024m. 3. Try lowering the number of workers ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just tried it… I dropped a 6.5GB file into assets and ran a build with no issues (aside from it being exceedingly slow to copy a 6.5GB file multiple times but I wanted to try a ridiculously large file, because why not. I can put up a PR for review, it’s pretty simple.
Ah, OK, that explains a good usage for HTML here. I’ve been very cautious about using large files on GitHub Pages after a few of my repos had to be basically wiped because there was too much storage space used.