Re: D1: Out of memory problems

2015-04-11 Thread jicman via Digitalmars-d-learn
On Saturday, 11 April 2015 at 20:45:25 UTC, Kagamin wrote: Parsers unique duplicated strings via a name table: string udup(string s, ref string[string] nameTable) { if(s in nameTable)return nameTable[s]; string s1=s.dup; nameTable[s1]=s1; return s1; } This way you avoid extra duplicates.

Re: D1: Out of memory problems

2015-04-11 Thread jicman via Digitalmars-d-learn
On Saturday, 11 April 2015 at 20:45:25 UTC, Kagamin wrote: Parsers unique duplicated strings via a name table: string udup(string s, ref string[string] nameTable) { if(s in nameTable)return nameTable[s]; string s1=s.dup; nameTable[s1]=s1; return s1; } This way you avoid extra duplicates.

Re: D1: Out of memory problems

2015-04-11 Thread Kagamin via Digitalmars-d-learn
Parsers unique duplicated strings via a name table: string udup(string s, ref string[string] nameTable) { if(s in nameTable)return nameTable[s]; string s1=s.dup; nameTable[s1]=s1; return s1; } This way you avoid extra duplicates. You can also try to free file content manually when it's p

Re: D1: Out of memory problems

2015-04-11 Thread jicman via Digitalmars-d-learn
On Friday, 10 April 2015 at 13:47:52 UTC, Kagamin wrote: On Tuesday, 7 April 2015 at 15:28:21 UTC, jicman wrote: H... Will you be able to give me an example of what is bad and then fix that bad to a good? This may be my problem... maybe aTUs = AddToTrackerRepeat(aTUs, source.dup, fn, 1, t

Re: D1: Out of memory problems

2015-04-07 Thread jicman via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 08:58:31 UTC, Kagamin wrote: Depends on how you fill aTUs. Ok, I will bite... ;-) I have the wText string which could be 20 mgs or so, I start finding pieces of data like this, wText = wText[std.string.find(wText,"") + 5 .. $]; so, everything before , including i

Re: D1: Out of memory problems

2015-04-07 Thread jicman via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 09:03:19 UTC, Kagamin wrote: For example if you slice the original string, it will be preserved in memory. That's why parsers keep parsed substrings by duplicating them - this can result in smaller memory footprint. H... Will you be able to give me an example o

Re: D1: Out of memory problems

2015-04-07 Thread Kagamin via Digitalmars-d-learn
For example if you slice the original string, it will be preserved in memory. That's why parsers keep parsed substrings by duplicating them - this can result in smaller memory footprint.

Re: D1: Out of memory problems

2015-04-07 Thread Kagamin via Digitalmars-d-learn
Depends on how you fill aTUs.

D1: Out of memory problems

2015-04-06 Thread jicman via Digitalmars-d-learn
Greetings. I am using, 15:32:35.63>dmd Digital Mars D Compiler v1.046 Copyright (c) 1999-2009 by Digital Mars written by Walter Bright Documentation: http://www.digitalmars.com/d/1.0/index.html And I have a program that reads a file into UTF8 and does a series of string handling to create rep

Re: D1: out of memory

2011-01-24 Thread %u
== Quote from Robert Clipsham (rob...@octarineparrot.com)'s article > CTFE and templates will use up the most memory - particularly if you use > a lot of strings, as the memory allocated is never freed. You can work > around it be compiling files one at a time or a few at a time, so > instead of: >

Re: D1: out of memory

2011-01-24 Thread Robert Clipsham
On 24/01/11 22:14, %u wrote: How do I get dmd's memory usage a few hundred MBs down? I keep having to close everything in order not to get an out of memory error while compiling (-w -full). I'd like to get it from 700-800 to below 400 :) Any way to inspect which part is the biggest drain? CTFE

Re: D1: out of memory

2011-01-24 Thread %u
Er, bit exaggerated.. 450 to below 300 pls :)

D1: out of memory

2011-01-24 Thread %u
How do I get dmd's memory usage a few hundred MBs down? I keep having to close everything in order not to get an out of memory error while compiling (-w -full). I'd like to get it from 700-800 to below 400 :) Any way to inspect which part is the biggest drain?