Skip to content
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

Implement memory tracking for handful of classes #1625

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Feb 6, 2024

  • cache
  • cf-property
  • form-data
  • hyperdrive
  • kv
  • queue

@jasnell jasnell requested review from a team as code owners February 6, 2024 16:29
* cache
* cf-property
* form-data
* hyperdrive
* kv
* queue
@jasnell jasnell force-pushed the jsnell/even-moar-memorytracker branch from 54bcc23 to 3911304 Compare February 6, 2024 16:32
@@ -536,7 +536,7 @@ void MemoryTracker::trackField(
decCurrentNodeSize(sizeof(T));
}
pushNode(nodeName.orDefault(edgeName), sizeof(T), edgeName);
for (const auto item : value) {
for (const auto& item : value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this change do? Originally were we copying the value and now we don't? So:

  • The original code trigger a compile error if T doesn't have a compile error?
  • If T was a large value before, we would copy each entry just to calculate it's size?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original was a bug. This template previously wasn't being used yet so it hadn't been caught.

@jasnell jasnell merged commit 15f4640 into main Feb 6, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants