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