-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbage collection changes in 8.7.0 #917
Comments
/CC @nodejs/v8 |
Are the spikes problematic? Is it affecting latency or throughput? Also, what do you measure? RSS, JS heap size, something else? |
@bnoordhuis The spikes themselves are only rarely problematic, but the change in footprint is. Instead of a clear baseline, there is now a huge deviation between the upper-bound and lower-bound of the used memory, with the upper-bound sometimes being as much as 3 times the baseline (see attached image), while the software runs on a device with only 512mb RAM. Before 8.7.0 this has never caused any problems, but now the system starts swapping a lot of memory back and forth to deal with these changes. The spikes themselves only cause problems when they occur simultaneously with a (non-nodejs) speech synthesis thread that plays generated speech over a speaker. The output starts to lag in this case, most likely due to a combination of swapping and higher cpu usage. The measurements are of the RSS, and are taken by |
As a sidenote, I've downgraded Node to 8.6.0, and can confirm the old memory footprint returned. |
There are no incremental sweeps. Full GCs do incremental marking, parallel compaction and concurrent sweeping. Incremental marking is started when being close to some heap limit. The spikes look like something is allocating a lot of garbage memory at a high rate. Could you post the output when running with |
Also, if you are running with any heap limits (e.g. |
I was running with |
@mlippautz It's been running for 1 hour now, but it looks like the huge spikes do not show up when running with the trace flags. |
The flags only print and don't change behavior. Also, unsurprisingly, the log doesn't show any odd behavior. |
I'll restart it and let it run over the night to see if anything changes, as the previous graphs all spanned multiple days. |
I am looking at the trace-gc.log and cannot observe any pauses > 250ms (which are memory reducing GCs and bigger pause times are expected there). Are you inspecting sums? |
Ah, never mind. I was looking at 'Total time spent in GC' but that's the sum of all cycles, not total time for an individual GC cycle. |
Maybe these logs are of more help, unfortunately the first part of the log got truncated due to the log size, but the captured time span covers multiple spikes. trace-gc.log |
Thanks for providing the log. The symptoms are that used memory stays rather stable while committed increases due too scavenges (minor GCs). @hashseed @ofrobots Related bug is https://bugs.chromium.org/p/chromium/issues/detail?id=771966 and even though it was not relevant for chrome it should definitely be backmerged to node. |
@targos I know it's hard and annoying to give ETA's, but this issue is currently blocking our ability to release software updates to our platform. Would you recommend reverting to Node 8.6.0 for now, or is the PR going to get included in an 8.x release within reasonable time? |
Original commit message: [heap] Ensure progress in unmapping memory chunks. If sweeping is not making progress and there are many young generation GCs happening, then this can lead to accumulation of memory chunks in the unmapper queue. Bug: chromium:771966 Change-Id: Ief73ada0d17198a80b668850c6d2e7ea413113e7 Reviewed-on: https://chromium-review.googlesource.com/702479 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48312} Refs: v8/v8@2c75616 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Fix threshold for delayed chunks after 2c7561. Bug: chromium:771966 Change-Id: Iac5ee55c0d31de477f21f091f4be015a1ca8d00c Reviewed-on: https://chromium-review.googlesource.com/702382 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48316} Refs: v8/v8@676c413 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Print the number of chunks in unmapper queue in --trace-gc-nvp Bug: chromium:771966 Change-Id: I146b279c4713b7dd716c6d55ca5e6c6e23a3ad7e Reviewed-on: https://chromium-review.googlesource.com/704740 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48338} Refs: v8/v8@e0d64dc Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Ensure progress in unmapping memory chunks. If sweeping is not making progress and there are many young generation GCs happening, then this can lead to accumulation of memory chunks in the unmapper queue. Bug: chromium:771966 Change-Id: Ief73ada0d17198a80b668850c6d2e7ea413113e7 Reviewed-on: https://chromium-review.googlesource.com/702479 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48312} Refs: v8/v8@2c75616 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Fix threshold for delayed chunks after 2c7561. Bug: chromium:771966 Change-Id: Iac5ee55c0d31de477f21f091f4be015a1ca8d00c Reviewed-on: https://chromium-review.googlesource.com/702382 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48316} Refs: v8/v8@676c413 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Print the number of chunks in unmapper queue in --trace-gc-nvp Bug: chromium:771966 Change-Id: I146b279c4713b7dd716c6d55ca5e6c6e23a3ad7e Reviewed-on: https://chromium-review.googlesource.com/704740 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48338} Refs: v8/v8@e0d64dc Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Ensure progress in unmapping memory chunks. If sweeping is not making progress and there are many young generation GCs happening, then this can lead to accumulation of memory chunks in the unmapper queue. Bug: chromium:771966 Change-Id: Ief73ada0d17198a80b668850c6d2e7ea413113e7 Reviewed-on: https://chromium-review.googlesource.com/702479 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48312} Refs: v8/v8@2c75616 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Backport-PR-URL: #16569 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Fix threshold for delayed chunks after 2c7561. Bug: chromium:771966 Change-Id: Iac5ee55c0d31de477f21f091f4be015a1ca8d00c Reviewed-on: https://chromium-review.googlesource.com/702382 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48316} Refs: v8/v8@676c413 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Backport-PR-URL: #16569 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Ensure progress in unmapping memory chunks. If sweeping is not making progress and there are many young generation GCs happening, then this can lead to accumulation of memory chunks in the unmapper queue. Bug: chromium:771966 Change-Id: Ief73ada0d17198a80b668850c6d2e7ea413113e7 Reviewed-on: https://chromium-review.googlesource.com/702479 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48312} Refs: v8/v8@2c75616 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Backport-PR-URL: nodejs#16413 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Fix threshold for delayed chunks after 2c7561. Bug: chromium:771966 Change-Id: Iac5ee55c0d31de477f21f091f4be015a1ca8d00c Reviewed-on: https://chromium-review.googlesource.com/702382 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48316} Refs: v8/v8@676c413 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Backport-PR-URL: nodejs#16413 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Print the number of chunks in unmapper queue in --trace-gc-nvp Bug: chromium:771966 Change-Id: I146b279c4713b7dd716c6d55ca5e6c6e23a3ad7e Reviewed-on: https://chromium-review.googlesource.com/704740 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48338} Refs: v8/v8@e0d64dc Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Backport-PR-URL: nodejs#16413 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Ensure progress in unmapping memory chunks. If sweeping is not making progress and there are many young generation GCs happening, then this can lead to accumulation of memory chunks in the unmapper queue. Bug: chromium:771966 Change-Id: Ief73ada0d17198a80b668850c6d2e7ea413113e7 Reviewed-on: https://chromium-review.googlesource.com/702479 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48312} Refs: v8/v8@2c75616 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Fix threshold for delayed chunks after 2c7561. Bug: chromium:771966 Change-Id: Iac5ee55c0d31de477f21f091f4be015a1ca8d00c Reviewed-on: https://chromium-review.googlesource.com/702382 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48316} Refs: v8/v8@676c413 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Print the number of chunks in unmapper queue in --trace-gc-nvp Bug: chromium:771966 Change-Id: I146b279c4713b7dd716c6d55ca5e6c6e23a3ad7e Reviewed-on: https://chromium-review.googlesource.com/704740 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#48338} Refs: v8/v8@e0d64dc Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: nodejs#16490 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Ensure progress in unmapping memory chunks. If sweeping is not making progress and there are many young generation GCs happening, then this can lead to accumulation of memory chunks in the unmapper queue. Bug: chromium:771966 Change-Id: Ief73ada0d17198a80b668850c6d2e7ea413113e7 Reviewed-on: https://chromium-review.googlesource.com/702479 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48312} Refs: v8/v8@2c75616 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Backport-PR-URL: #16413 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Fix threshold for delayed chunks after 2c7561. Bug: chromium:771966 Change-Id: Iac5ee55c0d31de477f21f091f4be015a1ca8d00c Reviewed-on: https://chromium-review.googlesource.com/702382 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48316} Refs: v8/v8@676c413 Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Backport-PR-URL: #16413 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original commit message: [heap] Print the number of chunks in unmapper queue in --trace-gc-nvp Bug: chromium:771966 Change-Id: I146b279c4713b7dd716c6d55ca5e6c6e23a3ad7e Reviewed-on: https://chromium-review.googlesource.com/704740 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#48338} Refs: v8/v8@e0d64dc Refs: nodejs/help#917 (comment) Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=771966 PR-URL: #16490 Backport-PR-URL: #16413 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
After updating from Node 8.4.0 to Node 8.7.0 (and thus V8 6.0 to 6.1), I noticed some significant changes in the memory profile of our application. There are a lot of spikes as if there is a periodic full garbage collect instead of smaller incremental sweeps. Is this intended behaviour?
Left side is 8.4.0, right side is 8.7.0.
The text was updated successfully, but these errors were encountered: