Hello, any one having problem with memory consumption of MyController? I don't know if its normal, but in my case the java process is consuming almost 2Gb of memory of my system. Is this normal? And if yes, is there any way to reduce this value?
Mine is running on a 20% mem usage on a 30 days uptime
I have 16Gb on my system, so 20% would be 3.2 Gb, I have 2Gb, and seems a bit high, I had a problem with memory today in my server, and was looking at the top memory users, and found MyController on the top of the list. I sill only installed My controller, nothing configured yet. Only assign the Gateway and it auto discovered the nodes. I even disabled the MQTT server, since I already have one running.
sorry, on a raspberry Pi 3, but java is known to be a little resource hungry
So we are talking about 200Mb of consumption... If its the Rp3 (1Gb Ram)...
I have no experience with MyController but the java virtual machine can be set to not expand memory usage above for example 256MB by setting Xmx256m. More info: https://alvinalexander.com/blog/post/java/java-xmx-xms-memory-heap-size-control
The Xmx parameter is set in the MyController start script: https://github.com/mycontroller-org/mycontroller/blob/development/dist/src/main/package/bin/start.sh#L27
But it looks like the default setting is 256MB so I don't understand why your instance is using 2GB. Could you check your start script?
Afther some googling I changed the start.sh
#Java Heap settings HEAP_MIN=-Xms32m HEAP_MAX=-Xmx256m
#Java Heap settings HEAP_MIN="-Xms32m -XX:PermSize=32m" HEAP_MAX="-Xmx256m -XX:MaxPermSize=256m -Xss1m"
And now the max memory is respected...
Some dev can pronounce him self if this can give any problems....
Thank You all
I can mention that I run MyController in a FreeNas Jail (FreeBSD Jail) and is working well, I had to do some teweeking to make it work. If someone is interested I can Make a tutorial on how to adapt the MyController to work in FreeBSD
@soloam great work.
Note: If you are able to upgrade to Java 8, you should no longer need to set XX:MaxPermSize
If you want to dig deeper into the memory usage, use the command jstat -gcutil to get access to a lot of information.