Ktor server uses a lot of memory
My ktor server uses a lot of memory , I do not know how it should be or I have problems with the code . Did the ktor server fail how much memory does it consume for you ?
![No description](https://cdn.answeroverflow.com/1164294847004409886/2023-10-18_213530.png)
53 Replies
Project ID:
N/A
That is a lot of memory 👀
What does your ktor server do?
Your KTOR is using what engine? JVM?
there's also the chance ktor is starting far too many worker processes
try to set fixed group sizes like in this example
https://ktor.io/docs/configuration-code.html#embedded-engine
Yes
It 's a small messenger , but I 'm developing it , there aren 't even any users there yet
Is it important? , there 's just another Kotlin SDK there , but I can 't build a project through it
Maybe u can manipulate jvm arguments to lower the max and minimum ram it uses, just my thought tho, since its a consistent usage
My server is simple, folders in which there are files in which various routes are recorded, receive here, send here and everything uses the database database.
![No description](https://cdn.answeroverflow.com/1164309509167124650/2023-10-19_000847.png)
![No description](https://cdn.answeroverflow.com/1164309568579448962/2023-10-19_000921.png)
There are many different routes in the program , and I call them in the main function
^
This did not help the server for some reason still uses a large amount of memory @Brody
![No description](https://cdn.answeroverflow.com/1164570210402050088/2023-10-19_172332.png)
![No description](https://cdn.answeroverflow.com/1164570210691448922/2023-10-19_172355.png)
look into lowering the max amount of ram it can use
Stack Overflow
What are the -Xms and -Xmx parameters when starting JVM?
Please explain the use of the Xms and Xmx parameters in JVMs. What are the default values for them?
I believe 2gb is the default, so your usage makes sense