GWT Dev Mode - Ideal memory settings

270 views
Skip to first unread message

Kanagaraj M

unread,
Dec 12, 2011, 1:04:43 AM12/12/11
to google-we...@googlegroups.com
I am running a big GWT (Maven + Hibernate) application in dev mode (eclipse).
My memory settings are 
-Xmx1024M -XX:MaxPermSize=384m
But, the application is taking too much time to start. and i have to wait for long time to see the page. 
Any solutions for this?
Thanks in advance.

Ed

unread,
Dec 12, 2011, 3:39:53 AM12/12/11
to Google Web Toolkit
Your settings are ok.
I use:
-Xms1024m
-Xmx1512m
For a "large" gwt app > 1 MB initial download unzipped.
I have a quad core with 8MB ram.
Check your dev computer and make sure your app does things lazily and
not create all at the beginning.
- Ed

On Dec 12, 7:04 am, Kanagaraj M <kanagaraj....@gmail.com> wrote:
> I am running a big GWT (Maven + Hibernate) application in dev mode
> (eclipse).
> My memory settings are

> *-Xmx1024M -XX:MaxPermSize=384m*

Thomas Broyer

unread,
Dec 12, 2011, 4:58:35 AM12/12/11
to google-we...@googlegroups.com
Not much related to memory I think. Sure, more memory helps, but there are other things to check, the most important probably being:

1. reduce the DevMode classpath to the minimum necessary. One common mistake (which the GPE or "mvn gwt:run" do by default, but they technically cannot do otherwise due to limitations of Eclipse and Maven) is to include server-side dependencies in the classpath for the DevMode: server-side code are loaded from the WEB-INF, like in any webapp, they don't need to be on the classpath for the servlet-container (you're not tweaking the classpath for Tomcat –or whatever your servlet container– when deploying a new webapp, right?)

2. use a fast I/O: an SSD, or even a ramdisk. (honestly, I've never done that, but I've heard many people saying it really helps)

Kanagaraj M

unread,
Dec 12, 2011, 6:08:22 AM12/12/11
to google-we...@googlegroups.com
Thanks for your response.

I removed some unwanted maven dependencies, as my application is a set of maven modules. I removed the unused ones. Now i saved nearly 30 seconds of startup time.
But i have another problem, i have dependency with a framework module (which i dont have access). Which is having nearly a dependency of 50 jars.
How can i avoid them to included in my classpath?

Ed

unread,
Dec 12, 2011, 9:32:25 AM12/12/11
to Google Web Toolkit
> How can i avoid them to included in my classpath?

I think you should setup your package structure well. Preferable right
from the start as it overcomes GWT warnings/problems (I still have to
change some of my packages).

Example:
server-project:
com.bla.server

client-project:
com.bla.client

common-project:
com.bla.common

The server project will have the dependency to your framework
dependency you refer to and the client project that contains the gwt
stuff, won't.
Both project don't have direct dependencies to eachother, but both
client and server project do have dependencies to the common project.

BTW: I did put in a SSD a few weeks ago, and it wasn't the "Wauuuuu"
difference that I excepted, but it did improved some of course during
dev mode.
I think that to get fast compiles: it's a combination of things and I
noticed that RAM and cores are important.

- Ed

qwertz

unread,
Dec 12, 2011, 10:01:36 AM12/12/11
to google-we...@googlegroups.com
In Maven you can exclude transitive dependendies:

<dependencies>
    <dependency>
        <groupId>com.example</groupId>
        <artifactId>your-framework-dependency</artifactId>
        <version>X.y</version>
        <exclusions>
            <exclusion>
            <groupId>com.example</groupId>
            <artifactId>stuff-you-dont-need</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

But as Ed said, you should have an eye on your overall 'architecture'.
Reply all
Reply to author
Forward
0 new messages