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
Please enter at least three characters to search
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

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

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

Related

  • Memory-Optimized Tables: Implementation Strategies for SQL Server
  • Analyzing “java.lang.OutOfMemoryError: Failed to create a thread” Error
  • Mastering Ownership and Borrowing in Rust
  • Fixing OutOfMemoryErrors in Java Applications

Trending

  • Creating a Web Project: Caching for Performance Optimization
  • Intro to RAG: Foundations of Retrieval Augmented Generation, Part 2
  • Implementing API Design First in .NET for Efficient Development, Testing, and CI/CD
  • Modern Test Automation With AI (LLM) and Playwright MCP

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.8K 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-Optimized Tables: Implementation Strategies for SQL Server
  • Analyzing “java.lang.OutOfMemoryError: Failed to create a thread” Error
  • Mastering Ownership and Borrowing in Rust
  • Fixing OutOfMemoryErrors in Java Applications

Partner Resources

×

Comments
Oops! Something Went Wrong

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
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!