• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to calculate memory required by my Spring boot application to run on server?

 
Ranch Hand
Posts: 649
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have build a REST api using Spring boot. The database has 39 tables and the number of Rest controllers are 31. Considering 2000 daily users which hit the API, how do I caclulate the RAM required on AWS ec2(or any xyz cloud provider) for running the API efficiently? As of now I am using their free tier which comes with 1core 1GB ram. But my application keeps on crashing. It stops even when I am not hitting the API. Sometimes logs are getting generated which shows memory issues and maximum times it stops without any server logs.
I have deployed the REST API using java -jar

Thanks
 
Saloon Keeper
Posts: 22112
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first thing to consider is whether your RAM requirements are including running a database or if you're using a database on an external server. AWS does provide ready-to-use database server images. If you're running a database on the same machine as the web service, then the RAM requirements are going to be much higher, since most databases eat a lot of RAM themselves.

As far as telling your RAM requirements for your Spring Boot app, you can simply launch it and use your operating system utilities to find out how much RAM it is using. The "top" command works for Linux and other Unix-style OS's. In Windows, it's the Task Manager that will tell you.

Then realize that the JVM launches with certain pre-set memory allocations and that they may need to be adjusted. To tell how much RAM within the VM is being used, a good Java performance monitoring tool can be used.
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic