Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uphttp2: track memory allocated by nghttp2 #21374
Conversation
addaleax
added
blocked
http2
labels
Jun 16, 2018
addaleax
force-pushed the
addaleax:track-memory-http2
branch
from
f8aa056
to
922f2ec
Jun 16, 2018
This comment has been minimized.
This comment has been minimized.
|
Woo! |
jasnell
approved these changes
Jun 17, 2018
trivikr
added
the
C++
label
Jun 17, 2018
apapirovski
approved these changes
Jun 17, 2018
TimothyGu
reviewed
Jun 18, 2018
src/node_http2.h
Outdated
| // Tell our custom memory allocator that this rcbuf is independent of | ||
| // this session now, and may outlive it. | ||
| void StopTrackingRcbuf(nghttp2_rcbuf* buf); | ||
|
|
||
| // Returns the current session memory including the current size of both | ||
| // the inflate and deflate hpack headers, the current outbound storage |
This comment has been minimized.
This comment has been minimized.
TimothyGu
Jun 18, 2018
Member
Might want to change the hpack headers part, as it is no longer visible in code?
This comment has been minimized.
This comment has been minimized.
TimothyGu
approved these changes
Jun 18, 2018
addaleax
force-pushed the
addaleax:track-memory-http2
branch
from
922f2ec
to
50a9d42
Jun 20, 2018
addaleax
force-pushed the
addaleax:track-memory-http2
branch
from
50a9d42
to
fa8d967
Jun 20, 2018
addaleax
removed
the
blocked
label
Jun 20, 2018
This comment has been minimized.
This comment has been minimized.
|
Rebased, this should no longer be blocked |
addaleax
added
the
author ready
label
Jun 20, 2018
TimothyGu
approved these changes
Jun 21, 2018
|
Still LGTM. |
| if (mem != nullptr) { | ||
| // Adjust the memory info counter. | ||
| session->current_nghttp2_memory_ += size - previous_size; | ||
| *reinterpret_cast<size_t*>(mem) = size; |
This comment has been minimized.
This comment has been minimized.
TimothyGu
Jun 21, 2018
Member
It took me a while to realize how this would behave for a size of 0: our UncheckedRealloc implementation will return nullptr in that case, to fill in an implementation-defined gap in the system realloc(). It might be helpful to clarify that.
ChALkeR
added
the
memory
label
Jun 22, 2018
This comment has been minimized.
This comment has been minimized.
|
Landed in 15c627f |
apapirovski
closed this
Jun 25, 2018
apapirovski
added a commit
that referenced
this pull request
Jun 25, 2018
targos
added a commit
that referenced
this pull request
Jun 25, 2018
kjin
added a commit
to kjin/node
that referenced
this pull request
Aug 23, 2018
kjin
added a commit
to kjin/node
that referenced
this pull request
Sep 17, 2018
kjin
added a commit
to kjin/node
that referenced
this pull request
Sep 19, 2018
kjin
added a commit
to kjin/node
that referenced
this pull request
Sep 25, 2018
kjin
added a commit
to kjin/node
that referenced
this pull request
Oct 16, 2018
BethGriggs
added a commit
to BethGriggs/node
that referenced
this pull request
Oct 16, 2018
BethGriggs
added a commit
that referenced
this pull request
Oct 17, 2018
beevelop
referenced this pull request
Nov 20, 2018
Closed
2018-11-20 Version 8.13.0 'Carbon' (LTS) @MylesBorins prepared by @BethGriggs #250
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
addaleax commentedJun 16, 2018
Provide a custom memory allocator for nghttp2, and track
memory allocated by the library with it.
This makes the used-memory-per-session estimate more
accurate, and allows us to track memory leaks either
in nghttp2 itself or, more likely, through faulty
usage on our end.
It also allows us to make the per-session memory limit
more accurate in the future; currently, we are not
handling this in an ideal way, and instead let nghttp2
allocate what it wants, even if that goes over our limit.
Refs: #21373
Refs: #21336
[blocked by both of these fixes]
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes