-
Notifications
You must be signed in to change notification settings - Fork 686
Description
Our current business operations have noticed a significant decline in the performance of JavaScript code execution, especially when the machine has limited remaining memory. Under normal circumstances, these JavaScript codes typically execute in about 20ms, but when memory is insufficient, the execution time increases to 500ms, which is a substantial performance degradation. We suspect that the issue is due to insufficient machine memory, and the garbage collection (GC) process is taking too long, causing the business code to run slowly. By setting the parameters --gc-mark-limit=16 --gc-limit=16384 --system-allocator=ON, we found that the performance of the business code improved significantly, generally reducing to 5ms, and even when memory is insufficient, it only takes 60ms. We have the following questions:
- Will modifying these parameters greatly improve performance? Are there any other parameters that can be set to further optimize performance?
- Our current business configuration uses -mem-heap=10240, and the maximum memory usage during peak times is about 7MB. If we set these parameters, can we achieve optimal performance?
- Using -system-allocator=ON will employ the system's malloc. Will this lead to a large amount of memory fragmentation, thereby occupying more memory? How can we balance these two aspects?
- Is there any plan to implement a feature that uses both a memory pool and system memory, where small memory allocations use the memory pool and larger allocations use system memory?