dmd memory usage

Steven Schveighoffer schveiguy at gmail.com
Mon Nov 18 15:29:46 UTC 2019


On 11/17/19 7:33 PM, Adam D. Ruppe wrote:
> On Monday, 18 November 2019 at 00:20:12 UTC, Steven Schveighoffer wrote:
>> Is there a straightforward way to figure out how much memory the 
>> compiler uses during compilation?
> 
> So this isn't a great solution but what I have done in the past is just 
> have a little script running
> 
> ps aux | grep dmd
> sleep 1 # or whatever time you want
> 
> in a loop running in the background to gather some data as it goes. If 
> combined with dmd -v you can interpolate the -v and ps output to get an 
> idea of what the memory use is at a certain point of what the compiler 
> is working on.
> 
> again i know it isn't great but it is easy to play with and better than 
> nothing

Yeah, I started trying out valgrind, which seems to give a decent 
report. It slows down the compiler a bit, but that's ok.

In any case, I realized that I need to write some more targeted tests, 
because the template I want to replace is used all over the place, so I 
would need to change them all in order to reduce memory usage.

-Steve


More information about the Digitalmars-d-learn mailing list