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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Does a Bigger Context Window Mean Better Memory: Understanding Context Windows, Model Memory, and RAG
  • How Cache Invalidation Caused Memory Pressure and API Failures at Scale
  • Remember Me, Safely: Durable and Governed Memory for Enterprise AI Agents
  • Why Incident Response Needs Memory, Not Just Intelligence

Trending

  • Member Spotlight: Shai Almong
  • How to Build Your Own AI SRE From Scratch
  • Introduction to Error Prone: How to Catch Bugs at Compile Time
  • How to Migrate From C/C++ to Rust: A Practical Guide for Embedded IoT Systems

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

GWT Compiler Is Running Out of Memory

By 
Ted Vinke
·
Mar. 22, 13 · Interview
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
14.6K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

  • Does a Bigger Context Window Mean Better Memory: Understanding Context Windows, Model Memory, and RAG
  • How Cache Invalidation Caused Memory Pressure and API Failures at Scale
  • Remember Me, Safely: Durable and Governed Memory for Enterprise AI Agents
  • Why Incident Response Needs Memory, Not Just Intelligence

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook