You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing code in Dotcore 2.0 and trying to use Process.GetCurrentProcess().PrivateMemorySize64 on Linux will yield 0 as a result where by Windows OS's return the expected results.
Is this intended ?
Reacted by Matthew Vaughan, Denis Dollfus, Cijo Thomas and cocowalla
(Regardless, if the right values are available, it'd make sense to use that data to better populate the info object... though I think I'd want to see statm parsed rather than status.)
If we need stack size we can very easily add value of VmStk from the same /proc/{pid}/status data to total VmData in order to get VmData + stack size. Not like it'll make the value that much different anyway, but if Windows does that, then we can do it too.
Is there any plan to bring this fix to OSX as well? I'm currently using the WorkingSet64 property but that overestimates the amount of memory consumed.
Reacted by Steven Kirk, Dan Walmsley, Anders Heintz, Weihan Li and cocowalla
ghost locked as resolved and limited conversation to collaborators on Dec 20, 2020
Activity
TAGC commentedon Aug 21, 2017
This issue can be reproduced in microsoft/dotnet:2.0-sdk:
Output
danmoseley commentedon Aug 21, 2017
It seems to me the code could be improved to do as it says, at least fill it in for the current process. @Jimmy062006 was that what you needed it for?
danmoseley commentedon Aug 21, 2017
@stephentoub may be able to remember why he didn't do that.
stephentoub commentedon Aug 21, 2017
This code reads from procfs. Which value maps to what's needed here?
stephentoub commentedon Aug 21, 2017
Does VmData actually represent the same value as all non-shared memory?
stephentoub commentedon Aug 21, 2017
Is it the right value then if stack is excluded? Is stack not included in PrivateMemorySize on Windows?
stephentoub commentedon Aug 21, 2017
(Regardless, if the right values are available, it'd make sense to use that data to better populate the info object... though I think I'd want to see statm parsed rather than status.)
JustArchi commentedon Aug 23, 2017
If we need stack size we can very easily add value of
VmStkfrom the same/proc/{pid}/statusdata to totalVmDatain order to getVmData+ stack size. Not like it'll make the value that much different anyway, but if Windows does that, then we can do it too.Jimmy062006 commentedon Aug 29, 2017
@danmosemsft I wanted to use it on a status command in the app I'm writing.
I then found out it worked fine in Windows but not Linux. So yes :)
danmoseley commentedon Aug 29, 2017
Does anyone on this thread want to take a shot at implementation? If so I will assign you the issue!
4 remaining items
tannergooding commentedon Aug 29, 2018
@danmosemsft, should this be marked
up for grabs?danmoseley commentedon Aug 29, 2018
Sure
Read data from /proc/[pid]/status in addition to /proc/[pid]/stat
Read data from /proc/[pid]/status in addition to /proc/[pid]/stat
Read values from /proc/[pid]/status (#41122)
Read values from /proc/[pid]/status (dotnet#41122)
Read values from /proc/[pid]/status (dotnet#41122)
Read values from /proc/[pid]/status (#41122) (#42370)
karelz commentedon Dec 19, 2019
Fixed in 3.1 in PR dotnet/corefx#42370 and in 5.0 (master) in PR dotnet/corefx#41122
thevioletsaber commentedon Jun 17, 2020
Is there any plan to bring this fix to OSX as well? I'm currently using the
WorkingSet64property but that overestimates the amount of memory consumed.