Perfetto plugin - Memory optimizations and table renaming#48
Perfetto plugin - Memory optimizations and table renaming#48KyleStorck merged 4 commits intomicrosoft:developfrom
Conversation
… of unused fields. Downsized datatypes
|
|
||
| public static string StringIntern(string str) | ||
| { | ||
| return str != null ? string.Intern(str) : string.Empty; |
There was a problem hiding this comment.
Are we ok with not releasing the memory if the trace is closed ? (per the MSDN article on string.Intern) or will just punt this for later?
A HashTable might just work for this and be free-able?
https://docs.microsoft.com/en-us/dotnet/api/system.string.intern?view=net-5.0
Performance Considerations
If you are trying to reduce the total amount of memory your application allocates, keep in mind that interning a string has two unwanted side effects. First, the memory allocated for interned String objects is not likely to be released until the common language runtime (CLR) terminates. The reason is that the CLR's reference to the interned String object can persist after your application, or even your application domain, terminates. Second, to intern a string, you must first create the string.
There was a problem hiding this comment.
I have not found a way to "close" a trace. Pressing "X" on the trace in graph explorer doesn't really close it. All the events stay in memory. So unless there really is a way to close a trace I think string.Intern is fine for now.
There was a problem hiding this comment.
Ok - this does seem to be the case for ETL as well at least from the UI. Closing graph explorer does indeed seem to leave everything in memory and you can re-open graph explorer from the Trace Menu. Keep in mind that this eventually may be used in-process C# Only DataLayer (no UI) with a processing harness, where the expectation would be to free memory after unloading the trace; so we should keep this in mind for later.
Made some memory optimizations to help improve the sluggishness in WPA when viewing large traces. Memory optimizations reduce memory usage by about 50%. UI is more responsive now. Optimizations include
Table renaming