digitalmars.D - Pegged and DMD Compilation Memory
- d coder (28/28) May 23 2012 Greetings
- Trass3r (1/3) May 23 2012 dmd simply never frees any memory it allocates.
- d coder (2/3) May 23 2012 Since GDC uses DMD front-end, I do not think I can get any relief by usi...
- Iain Buclaw (6/9) May 23 2012 No relief am afraid. I do know of someone in the past using the Boehm
- Trass3r (2/4) May 23 2012 Didn't they try to enable the GC in dmd recently but it was a little
- Jonathan M Davis (7/12) May 23 2012 Yeah. It hurt compile times considerably. I'm not sure what the current ...
- Trass3r (2/6) May 23 2012 What about good old properly managing the memory manually?
- Jonathan M Davis (4/12) May 23 2012 I have no idea how any of that stuff is set up in the compiler, so I don...
Greetings I am trying to use Pegged for compile time parsing. The only issue I am facing is with the compile time memory. I have a rather simple grammar, mostly derived from the arithmetic.d example that comes bundled with Pegged. I am wondering if the memory could be optimized by fine-tuning the code in the grammar that I have written. I am pasting the code down here for suggestions. On my 64-bit linux machine my small application is taking as much as 2.2GB of RAM at the time of compiling the code using DMD 2.059. I am using the latest Pegged code from github. Regards - Puneet mixin(grammar( "CstGrammar: CstSet < Cst+ Cst < Bool ';' Bool < Comparison BoolExpr* BoolExpr < ^('&&'/'||') Comparison Comparison < Expr CompExpr? CompExpr < ^('<='/'>='/'!='/'<'/'>'/'==') Expr Expr < Factor AddExpr* AddExpr < ^('+'/'-') Factor Factor < Primary MulExpr* MulExpr < ^('*'/'/') Primary Primary < Parens / Number / Variable / ^'-' Primary Parens < '(' Bool ')' Number <~ [0-9]+ Variable <- Identifier" ));
May 23 2012
I am trying to use Pegged for compile time parsing. The only issue I am facing is with the compile time memorydmd simply never frees any memory it allocates.
May 23 2012
dmd simply never frees any memory it allocates.Since GDC uses DMD front-end, I do not think I can get any relief by using that too. Right?
May 23 2012
On 23 May 2012 16:55, d coder <dlang.coder gmail.com> wrote:No relief am afraid. I do know of someone in the past using the Boehm GC with GDC, which vastly improved memory consumption. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';dmd simply never frees any memory it allocates.Since GDC uses DMD front-end, I do not think I can get any relief by using that too. Right?
May 23 2012
No relief am afraid. I do know of someone in the past using the Boehm GC with GDC, which vastly improved memory consumption.Didn't they try to enable the GC in dmd recently but it was a little disaster?
May 23 2012
On Wednesday, May 23, 2012 18:21:42 Trass3r wrote:Yeah. It hurt compile times considerably. I'm not sure what the current plan is, other than leaving it like it is for now. The current situation can result in pretty atrocious memory usage by dmd, but there are more critical things for Walter et al. to be working on, hence why it hasn't really been addressed yet. - Jonathan M DavisNo relief am afraid. I do know of someone in the past using the Boehm GC with GDC, which vastly improved memory consumption.Didn't they try to enable the GC in dmd recently but it was a little disaster?
May 23 2012
What about good old properly managing the memory manually? At least for new code and maybe improving old code gradually.Didn't they try to enable the GC in dmd recently but it was a little disaster?Yeah. It hurt compile times considerably. I'm not sure what the current plan is, other than leaving it like it is for now.
May 23 2012
On Wednesday, May 23, 2012 21:33:14 Trass3r wrote:I have no idea how any of that stuff is set up in the compiler, so I don't know what would or wouldn't be reasonable for it to do. - Jonathan M DavisWhat about good old properly managing the memory manually? At least for new code and maybe improving old code gradually.Didn't they try to enable the GC in dmd recently but it was a little disaster?Yeah. It hurt compile times considerably. I'm not sure what the current plan is, other than leaving it like it is for now.
May 23 2012