-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Honor Concord's TruncatedString flag to reduce memory usage #68969
Conversation
src/ExpressionEvaluator/Core/Source/ResultProvider/Formatter.Values.cs
Outdated
Show resolved
Hide resolved
...ExpressionEvaluator/Core/Source/ResultProvider/Helpers/DkmEvaluationResultFlagsExtensions.cs
Outdated
Show resolved
Hide resolved
Same suggestion from the Concord code review: I think we need to set a flag in the inspection context to indicate we want large strings rather than changing Refers to: src/ExpressionEvaluator/Core/Source/ResultProvider/Formatter.Values.cs:216 in 238d264. [](commit_id = 238d264, deletion_comment = False) |
@@ -253,7 +253,8 @@ private static DkmEvaluationResultFlags GetFlags(DkmClrValue value, DkmInspectio | |||
} | |||
} | |||
|
|||
if (!value.IsError() && value.HasUnderlyingString(inspectionContext)) | |||
// check for truncated string before HasUndleryingString so we don't pull the string into memory just to set the flag | |||
if (!value.IsError() && ((value.EvalFlags & (DkmEvaluationResultFlags)DkmEvaluationResultFlagsExtensions.TruncatedStringFlag) != 0 || value.HasUnderlyingString(inspectionContext))) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't HasUnderlyingString
also check for TruncatedStringFlag
when allocating the string?
(...does GetUnderlyingStringImpl
call into GetValueString?)
@@ -253,7 +253,8 @@ private static DkmEvaluationResultFlags GetFlags(DkmClrValue value, DkmInspectio | |||
} | |||
} | |||
|
|||
if (!value.IsError() && value.HasUnderlyingString(inspectionContext)) | |||
// check for truncated string before HasUndleryingString so we don't pull the string into memory just to set the flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
// check for truncated string before HasUndleryingString so we don't pull the string into memory just to set the flag | |
// check for truncated string before HasUnderlyingString so we don't pull the string into memory just to set the flag |
238d264
to
6569c2e
Compare
@@ -253,7 +253,8 @@ private static DkmEvaluationResultFlags GetFlags(DkmClrValue value, DkmInspectio | |||
} | |||
} | |||
|
|||
if (!value.IsError() && value.HasUnderlyingString(inspectionContext)) | |||
// check for truncated string before HasUndleryingString so we don't pull the string into memory just to set the flag | |||
if (!value.IsError() && (value.EvalFlags.HasFlag(DkmEvaluationResultFlags.TruncatedString) || value.HasUnderlyingString(inspectionContext))) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@tmat I believe this is ready to merge, although CI is very unhappy. Did I do something to upset CI or is this a known issue? The errors don't look like anything I've touched. |
166bcc8
to
94fd48e
Compare
…orks for large strings
94fd48e
to
6e41739
Compare
Concord is going to begin limiting the amount of memory it pulls from the target process for strings. Any string result that has been truncated is marked with a new flag, such that APIs like GetUnderlyingString can still work for things like string visualizers in order to surface the full bytes of the string.
This adds concords new flag as a temporary constant and ensures that HasUnderlyingValue and GetUnderlyingValue both still work without pulling in the full string memory unnecessarily.