Java Heap Size in Production

My application is going to have multiple simultaneous publishers, with no subscribers and the publisher screen would be recorded. I need to make sure that at least 50-60 such simultaneous recordings can happen smoothly.

I am not very familiar with JAVA Heap size configuration. The default value in OpenVidu CE is set as:

# Java Options
JAVA_OPTIONS=-Xms2048m -Xmx4096m

I have deployed it on a c4.2xLarge EC2 instance with 16GB RAM and 8vCPU. There’s nothing else on the instance and it only runs OpenVidu CE. My application runs on an entirely different instance. Should I update these values to match the server RAM? Will this be enough to support my use case?

# Java Options
JAVA_OPTIONS=-Xms2048m -Xmx8192m

EDIT: Currently I have set it to 50% of the total server RAM, i.e. 8GB. Can I set it to more than that? Should I set it to more than that? What is the suggested optimum value?

There is no “optimum value”. Try this values with your use case and let us know if it works well.