DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

SBOMs are essential to circumventing software supply chain attacks, and they provide visibility into various software components.

Related

  • Memory Leak Due To Mutable Keys in Java Collections
  • How to Troubleshoot Common Linux VPS Issues: CPU, Memory, Disk Usage
  • Advanced Java Garbage Collection Concepts: Weak References, Finalization, and Memory Leaks
  • Memory Leak Due to Uncleared ThreadLocal Variables

Trending

  • Software Specs 2.0: An Elaborate Example
  • The QA Paradox: To Save Artificial Intelligence, We Must Stop Blindly Trusting Data—And Start Trusting Human Judgment
  • Squid Game: The Clean Code Trials — A Java Developer's Survival Story
  • Self-Supervised Learning Techniques

GWT Compiler Is Running Out of Memory

By 
Ted Vinke user avatar
Ted Vinke
·
Mar. 22, 13 · Interview
Likes (0)
Comment
Save
Tweet
Share
13.9K Views

Join the DZone community and get the full member experience.

Join For Free

as part of evaluating an open-source framework which uses google web toolkit i ran into some of the familiar issues i already had a few times earlier with the gwt (gwt 2.4 or 2.5) maven plugin compilation running out of memory. you know, when you see…

…at the start:

[info] # there is insufficient memory for the java runtime environment to continue.
[info] # native memory allocation (malloc) failed to allocate 32744 bytes for chunkpool::allocate

…or during compilation:

[info]  compiling 12 permutations
[info]  compiling permutation 1...
[info]  process output
[info]  error occurred during initialization of vm
[info]  could not reserve enough space for object heap

this post is basically a compilation of the answers found online , and a quick reminder for myself and others who are running into similar problems with the fantastic gwt compiler :-) .

1. first of all, check if you actually need to compile everything! skip some browsers or locales – saving all kinds of permutations – if you don’t need it for development. use the tips about how to speed up the gwt compiler and gwt compilation performance . there’s also an existing faq about gwt debugging and compiling .if you have control of your machine, cut down on other running applications and processes while you’re compiling.

2. pass along some more memory

…to maven, e.g.:

maven_opts=-xms1024m -xmx1024m -xx:maxpermsize=256m

…and/or to the gwt-maven-plugin, e.g.:

<configuration>
  <extrajvmargs>-xms768m -xmx768m</extrajvmargs>
</configuration>

you’ll have to play a bit with the values, depending on the machine you’re working on and the actually available working ram.

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 to a number explicitly below your available cores/cpu’s. if this number isn’t defined explicitly, the gwt-maven-plugin will set these to the number of available cores/cpu’s. less workers = less parallellisation = less memory overhead.

<configuration>
  <extrajvmargs>-xms768m -xmx768m</extrajvmargs>
  <localworkers>3</localworkers>
</configuration>

4. try having the “workers” work in threads, instead of spawning new processes.

<configuration>
  <extrajvmargs>-xms768m -xmx768m -dgwt.jjs.permutationworkerfactory=com.google.gwt.dev.threadedpermutationworkerfactory</extrajvmargs>
  <localworkers>3</localworkers>
</configuration>

hopefully this will save someone some valuable time finding solutions. if you have other options, feel free to add them in the comments.

original article: http://tedvinke.wordpress.com/2013/03/21/gwt-compiler-is-running-out-of-memory

Memory (storage engine)

Published at DZone with permission of Ted Vinke. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Memory Leak Due To Mutable Keys in Java Collections
  • How to Troubleshoot Common Linux VPS Issues: CPU, Memory, Disk Usage
  • Advanced Java Garbage Collection Concepts: Weak References, Finalization, and Memory Leaks
  • Memory Leak Due to Uncleared ThreadLocal Variables

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: