digitalmars.D.learn - Get memory used by current process at specific point in time
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/3) Jan 12 2020 Is there a druntime/phobos function for getting the amount of
- Jacob Carlborg (5/7) Jan 13 2020 I don't think so. But if you're on macOS you can use Instruments
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/10) Jan 13 2020 I'm sitting on Linux :)
- Chris Katko (7/10) Jan 15 2020 Valgrind will tell you the exact usage (except no delineation for
- Jacob Carlborg (7/9) Jan 15 2020 There are some runtime flags that can be passed to the executable when
- Boris Carvajal (4/7) Jan 16 2020 At least for the GC I remember using GC.stats and GC.profileStats
Is there a druntime/phobos function for getting the amount of memory (both, stack, malloc, and GC) being used by the current process?
Jan 12 2020
On 2020-01-12 14:58, Per Nordlöw wrote:Is there a druntime/phobos function for getting the amount of memory (both, stack, malloc, and GC) being used by the current process?I don't think so. But if you're on macOS you can use Instruments (shipped with Xcode) and pick the Allocations template. -- /Jacob Carlborg
Jan 13 2020
On Monday, 13 January 2020 at 20:08:19 UTC, Jacob Carlborg wrote:On 2020-01-12 14:58, Per Nordlöw wrote:I'm sitting on Linux :) Thanks anwayIs there a druntime/phobos function for getting the amount of memory (both, stack, malloc, and GC) being used by the current process?I don't think so. But if you're on macOS you can use Instruments (shipped with Xcode) and pick the Allocations template.
Jan 13 2020
On Sunday, 12 January 2020 at 13:58:18 UTC, Per Nordlöw wrote:Is there a druntime/phobos function for getting the amount of memory (both, stack, malloc, and GC) being used by the current process?Valgrind will tell you the exact usage (except no delineation for GC) per here: https://stackoverflow.com/questions/131303/how-to-measure-actual-memory-usage-of-an-application-or-process Valgrind is an overall extremely useful tool for Linux devs. Still, some internal instrumentation would be nice. But I'm not aware of any.
Jan 15 2020
On 2020-01-15 19:45, Chris Katko wrote:Still, some internal instrumentation would be nice. But I'm not aware of any.There are some runtime flags that can be passed to the executable when running it to get some info about the GC. Of course these are not documented (except perhaps in the changelog). I'm too lazy to try to find them now. -- /Jacob Carlborg
Jan 15 2020
On Sunday, 12 January 2020 at 13:58:18 UTC, Per Nordlöw wrote:Is there a druntime/phobos function for getting the amount of memory (both, stack, malloc, and GC) being used by the current process?At least for the GC I remember using GC.stats and GC.profileStats to get some info. https://dlang.org/phobos/core_memory.html#.GC
Jan 16 2020