Java Spring Boot memory usage

Hello everyone! I'm making some tests with Railway and my Java Spring Boot app. I want to subscribe to Hobby Plan but I want to know something about memory usage. Memory usage in Railway's metrics is around 400MB, but it's always increasing. It only decrease when I restart a deployment, like few minutes ago. But, when I check metrics with actuator, I found something like this: JVM memory used: 189 MB. JVM memory committed (amount of memory that is guaranteed to be available for use by the JVM, it includes memory used): 234 MB. Maybe it's something I don't completely understand about Java memory usage or deployments. But if someone knows more about this, I would like to learn where can I find that 400 MB of memory explained. Thank you in advice!!
No description
No description
No description
9 Replies
Percy
Percy5mo ago
Project ID: eeab6790-3588-46f2-9c9d-b2f284705563
FaqRaviolo
FaqRaviolo5mo ago
eeab6790-3588-46f2-9c9d-b2f284705563
Brody
Brody5mo ago
sorry but this doesn’t really have to much do with railway, this is more so a general question about memory usage with java apps, and that has definitely been explained far better already on some blog or youtube video. I really dont mean to turn you away and id be happy to answer any railway related questions, but you can for sure find a far better answer to your question elsewhere
FaqRaviolo
FaqRaviolo5mo ago
Sure, but I want to know if I'm missing something, because as I can see, Java says that memory used is lower than memory that Railway says. So I want to discard any Railway bug on information or something
Brody
Brody5mo ago
JVM memory used 189 MB + JVM memory committed 234 MB = 423 MB
FaqRaviolo
FaqRaviolo5mo ago
I thought that before, but JVM memory commited includes used.
Brody
Brody5mo ago
like i said, someone on a blog or a youtube video could explain how memory with java works far better than i ever could. i can assure you there is no issue with the memory metrics railway is giving you, its the total container memory.
FaqRaviolo
FaqRaviolo5mo ago
Ok, I'll try to find the reason of that difference. Thanks!
Brody
Brody5mo ago
sorry i couldnt have been more help on this, but please do open a new thread for any railway related questions you may have!