-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Heartbeat] Improve browser heap memory usage (#32317)
This patch does not fix a potential memory leak as mentioned on the forum, but does dramatically increases heartbeat's efficiency WRT parsing the JSON output of the synthetics agent. It does appear that we don't close all the readers used by scanToSynthEvents which this patch fixes. I did observe heap growth w/o this patch over a short timescale, but that's almost certainly not a resource leak, those readers should have been auto closed when exec ended anyway. We do however waste a lot of memory / allocations buffering lines of JSON, which can be quite large. The json decoder can actually parse ndjson very efficiently itself. This also lets us use a smaller buffer for stdout/stderr buffering. We had allocated a larger one prior to handle the base64 image data passed by the agent.
- Loading branch information
Showing
2 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters