• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Mike London

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

Ranch Hand
Posts: 658
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

Saloon Keeper
Posts: 26556
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic