November 14, 2012 Re: [dmd-internals] Memory Leak | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | On 11/14/2012 1:03 AM, Don Clugston wrote: > > At least, the ones created by const-folding are short-lived, and there > is rather a lot of them. This is extreme for CTFE, which is why CTFE > leaks so much memory. > Though actually I want to stop CTFE from creating mountains of garbage > in the first place. > I don't know how much of the total garbage is from const folding though. > What do you think of the feasibility of just having CTFE use reference counting? _______________________________________________ dmd-internals mailing list dmd-internals@puremagic.com http://lists.puremagic.com/mailman/listinfo/dmd-internals | |||
November 14, 2012 Re: [dmd-internals] Memory Leak | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 14 November 2012 10:14, Walter Bright <walter@digitalmars.com> wrote: > > On 11/14/2012 1:03 AM, Don Clugston wrote: >> >> >> At least, the ones created by const-folding are short-lived, and there >> is rather a lot of them. This is extreme for CTFE, which is why CTFE >> leaks so much memory. >> Though actually I want to stop CTFE from creating mountains of garbage >> in the first place. >> I don't know how much of the total garbage is from const folding though. >> > > What do you think of the feasibility of just having CTFE use reference counting? I've been working towards CTFE owning all of its expressions. An interesting thing about CTFE is that it's all strongly pure, so a pool-based approach works really well. When CTFE finishes, copy the result into new Expressions not owned by CTFE. Then drop everything in the CTFE memory pool. _______________________________________________ dmd-internals mailing list dmd-internals@puremagic.com http://lists.puremagic.com/mailman/listinfo/dmd-internals | |||
November 14, 2012 Re: [dmd-internals] Memory Leak | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Brad Roberts Attachments:
|
On Nov 14, 2012, at 02:05 AM, Brad Roberts <braddr@puremagic.com> wrote:
> There was a question earlier in this thread (which I didn't save but meant to respond to) about the impact of the addition of the GC. From what I remember, the full dmd/druntime/phobos build and test cycle doubled in duration. No one, that I recall, spent any time trying to diagnose or improve it. Since we were up against a release, the choice was made to pull it out until someone does have the time to actually work on it, not just toss in an experiment.
I don't know how many times I have to keep saying this. These are things that should be tried and developed in a separate branch. Then there is no need to stop working on it just because a release is coming up.
--
/Jacob Carlborg
| |||
November 14, 2012 Re: [dmd-internals] Memory Leak | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | On 11/14/2012 4:30 AM, Don Clugston wrote: > > [...] > I've been working towards CTFE owning all of its expressions. > An interesting thing about CTFE is that it's all strongly pure, so a > pool-based approach works really well. When CTFE finishes, copy the > result into new Expressions not owned by CTFE. > Then drop everything in the CTFE memory pool. I.e.: A custom region allocator. That's pretty much the fastest kind you can get, but it does require you to manage lifetimes correctly. I suspect that larger portions of dmd could also benefit from a region allocator, but it may be harder to draw the line around the lifetime scope like you can with CTFE. Probably dmd needs to be profiled to see the big-picture pattern of allocations. Dave _______________________________________________ dmd-internals mailing list dmd-internals@puremagic.com http://lists.puremagic.com/mailman/listinfo/dmd-internals | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply