You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yaragalla Muralidhar <ya...@gmail.com> on 2016/05/04 17:13:10 UTC

heap space problem

Hi we have purchased a java private hosting with some service provider and
we have hosted some simple spring app with few database operations. the
heap space we got is 64mb. some times it used to get stoped so when we ask
the service provider he said we have to increase the heap space and we have
increased it to 128 mb and now the service provider says my app is taking
nearly 350 mb heap space. I am not sure what is going. does a simple spring
app takes more than 100mb. i have checked my app on tomcat 7 (on my
laptop)and it does not take much than 80mb. I have checked with jvisualvm
that comes with jdk.

can u provide some help on this.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*

Re: heap space problem

Posted by Yaragalla Muralidhar <ya...@gmail.com>.
Thank you Chris. Your mail is so helpful


*Thanks and Regards,*
Muralidhar Yaragalla.
*http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*

Re: heap space problem

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yaragalla,

On 5/4/16 1:13 PM, Yaragalla Muralidhar wrote:
> Hi we have purchased a java private hosting with some service
> provider and we have hosted some simple spring app with few
> database operations. the heap space we got is 64mb.

Spring is a pig. Often, the *permgen* needs to be more than 64MiB. A
64MiB heap is pretty much never going to meet your needs.

> some times it used to get stopped so when we ask the service
> provider he said we have to increase the heap space and we have 
> increased it to 128 mb and now the service provider says my app is
> taking nearly 350 mb heap space.

If you have a constrained heap, the heap itself won't exceed that. But
Java processes use more than just the heap space, so your provider is
probably talking about the full process memory, not the Java heap space.

> I am not sure what is going on. does a simple spring app takes more
> than 100mb. i have checked my app on tomcat 7 (on my laptop) and it
> does not take much than 80mb. I have checked with jvisualvm that
> comes with jdk.
> 
> can u provide some help on this.

My (vicarious) experience is that Spring-based web apps require a
great deal of heap space because *tons* of stuff gets loaded. Tomcat
with no applications requires about 12MiB of heap space the last time
I checked.

You need to talk to your hosting provider about what is and is not
reasonable for a server-side web application -- especially one that is
Java-based. Many el-cheapo-webapps are written in PHP which doesn't
even stay resident between requests, so memory usage is fairly low
unless you catch a long-running script. Java is a different beast and
if the service provider doesn't know that, they shouldn't be offering
it as a service.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlcqO4MACgkQ9CaO5/Lv0PAycgCeIcs/1P7EiQ720RB0U6j1p46s
kycAn3SqnR2w53KrKga+YwO9I2rMCr73
=g+jJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org