This provides visibility into how much memory we actually use.
Log example:
[2018-08-16T14:38:13.348+02:00] 18766 NOTIC js gc endKBytes:0 beginKBytes:112 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.403+02:00] 18766 NOTIC js gc endKBytes:0 beginKBytes:104 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.495+02:00] 18766 NOTIC js gc endKBytes:0 beginKBytes:148 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.554+02:00] 18766 NOTIC js gc endKBytes:0 beginKBytes:104 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.681+02:00] 18766 NOTIC js gc endKBytes:0 beginKBytes:192 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.781+02:00] 18766 NOTIC js gc endKBytes:104 beginKBytes:204 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.819+02:00] 18766 NOTIC js gc endKBytes:104 beginKBytes:184 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.841+02:00] 18766 NOTIC js gc endKBytes:104 beginKBytes:172 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.903+02:00] 18766 NOTIC js gc endKBytes:104 beginKBytes:176 scripting/jshandler.cpp:141
[2018-08-16T14:38:13.925+02:00] 18766 NOTIC js gc endKBytes:104 beginKBytes:176 scripting/jshandler.cpp:141
[2018-08-16T14:38:18.458+02:00] 18766 NOTIC js gc endKBytes:104 beginKBytes:196 scripting/jshandler.cpp:141
-
endKBytes
is memory usage after garbage collection. -
beginKBytes
is memory usage before garbage collection.
Ideas:
- do not log every gc run be default, but at INFO severity
- log WARNING when
endKBytes
is close to memory limit - log at NOTICE when maximal
endKBytes
increases - add property node
system/js/maxGcKBytes
with maximalendKBytes
value so that we can easily query how much javascript memory we really needed on given system.