1

My project is based on spring framework java. War size of my application is about 38mb. I hosted my application on vps with 1 gb RAM. Within some days i got to know that all RAM is getting exhausted.

Then i extend RAM by 1gb. Now single war file is working on 2 gb RAM using tomcat server. After 2-3 days i checked 2gb RAM also exhausted and it is showing around 80 to 90 percent usage.

Currently, system is under development and no one is using application still all RAM is getting used.

Is that a normal behavior Or there are any issues? or do i need to make any settings?

Can anyone tell me how much RAM getting used for normal java project..

I checked vps ram usage by 'free -m' command, It is showing that -/+ buffers/cache as 557 [used ] 1444 [free] Also Mem values are 2001[total] 1736[used] 265[free] 38[shared] 130[buffers] 1048[cached]

RohanB
  • 294
  • 2
  • 5
  • 19
  • How much ram an application need is highly application dependend. But I you have an application that doubles the needed ram in two days without load and you do not have any idea for the reason (for example a cache could be a valid reason). then I would say it is not normal and I would strongly recommend to investigate this issue (it is likely some kind of memory leak)! – Ralph Feb 26 '16 at 07:30
  • @Relph: i checked vps ram usage by 'free -m' command, It is showing that -/+ buffers/cache as 557 [used ] 1444 [free]. what does it mean? – RohanB Feb 26 '16 at 08:56

2 Answers2

1

In my opinion, normally it need 1GB RAM for small Java application. You need look into your code if any endless loops are there or any schedulers are running forever.

Le Quang Nhan
  • 165
  • 1
  • 3
  • 13
1

In addition to endless loops, check for memory leaks and issues related to not releasing resources like db links etc. Refer to similar issues reported by the community like below

Why is this Java program taking up so much memory?

How to reduce Spring memory footprint

http://www.toptal.com/java/hunting-memory-leaks-in-java

Community
  • 1
  • 1