Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my war take so much space when deployed on GAE?

When I compile my GAE/GWT (Java) project (compiling all 6 permutations), the whole WAR folder has a weight of 93.9 Mo on my computer (extended Mac OS journaled). When deployed on GAE, the Admin console (Quota Details page) shows that my app takes 18% of the free quota. Meaning 180Mb. How is this possible ? I am missing something ? Is google using a filesystem with big blocks ?? How to optimize the usage of the available storage space ? I'm already JARing my 'classes' folder, but the gain (in terms of space...) is not relevant.

The biggest problem (from my point of view) is that my own GWT + server side code + 'external' library (PDFJet) is taking a tiny 1.9Mb. All the rest (>91Mb) is taken by appengine's and datanucleus own libraries. Why do we need to include those in the deployment ? They are used by everyone. I think it would be better for all of us when these would be centrally and automatically deployed. I don't get it.

Any advices or comments on this ?

like image 594
Gaël Oberson Avatar asked Nov 16 '25 21:11

Gaël Oberson


1 Answers

You need to ensure GWT post compilation output is tuned towards production deployment and in your case for "cloud" .

Ensure for Production deployment

1) GWT Compiler flag for STYLE IS OBF

2) GWT Compilation turns off stack trace emulator feature. In .gwt.xml

<set-property name="compiler.stackMode" value="strip" />

Ensure for Cloud deployment

1) GWT Compiler flag for extra and deploy is used to direct away mostly deployment redundant files away from WAR file. I am guessing you have massive folder called deploy in your WEB-INF.

Edit -

1) Reference to GWT Compiler options - https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging

2) Reference to Google Group discussion - https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/-WtEfDvUI4g

like image 148
appbootup Avatar answered Nov 19 '25 11:11

appbootup



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!