Terminal Service Plus HTML5 Server runs on JAVA. Understanding how JAVA handles memory help to understand Terminal Service Plus HTML5 Server memory usage.
When Java runs, it tries to allocate 25% of the computer physical memory. This memory is “assigned” but not directly used – it is not the real memory usage that one can see in Windows Task Manager.
JAVA platform: 32-bit vs 64-bit
There is one big difference between these two platforms:
- JAVA 32-bit cannot handle more than 4GB of RAM by definition. Since it will allocate 25% of all available memory, it will allocate at most 1GB, assuming there is 4GB physical memory. If there is only 2GB physical memory, it will only allocate 500MB, etc.
- JAVA 64-bit can handle a lot more than 4GB (theoretically up to 16 exabytes), so the allocated memory will only depend on physical memory.
JAVA memory management
JAVA is a “virtual machine”. It means that JAVA handles memory management on its own. Once JAVA allocates some memory, even when it does not need it anymore, it will not automatically give it back to the system. This is for performance reasons, as memory allocating and de-allocating are CPU intensive tasks.
JAVA will usually wait until it has a big chunk of unused memory before giving it back to the system. The size of this big chunk directly depends on the size of the computer physical memory. The more physical memory on a computer, the more memory is allocated by JAVA.
Terminal Service Plus HTML5 Server Memory Usage
All these technical details are the reason why one can open Windows Task Manager and think that Terminal Service Plus HTML5 Server uses a lot of memory, or that JAVA 32 bit uses less memory than JAVA 64 bit.
Actually, the memory really used by Terminal Service Plus HTML5 Server is directly related to the number of opened HTML5 sessions. The more available memory on the computer, the more HTML5 sessions you can open.
HTML5 Session Memory Usage
The memory used by an HTML5 session depend on the user activities (applications and programs used, Word/Excel versus drawing-intensive programs) and the connectivity method established between the Terminal Service Plus HTML5 Server and the client computer.
In the general use case, an HTML5 session will use 30 MB of memory (standard use, binary websockets connectivity). In the worst case, a session will use up to 100 MB of memory (intensive use, “XHR” fallback connectivity for older browsers).