Re: limits of objects
Re: limits of objects
- Subject: Re: limits of objects
- From: Ben Dougall <email@hidden>
- Date: Fri, 22 Aug 2003 15:10:45 +0100
On Friday, August 22, 2003, at 01:01 pm, Jvrn Salewski wrote:
Once I had the same problem ("solved" at that time by postponing the
use of
regexs in my code). Now, I used the opportunity of this thread to have
a
closer look at the AGRegex code and found the culprit (obviously bad
memory
management as pointed out before):
The description of AGRegexMatch is lying about what it really contains.
right, so the description method outputs selectively.
Every match creates a COPY of the original string to search in! That
means
that if you expect ca. 2500 matches in a 280k file, you end up with
2500 *
280k = 700000k = about 680 MB of memory usage.
wow, not good. oh well, i guess it's just good for small numbers, or
intricate matching, rather than bulk stuff - as you say, postponing the
use of it.
If one doesn't alter the original string while working on the resulting
matches, it should be fairly safe to change the copy to retain in the
init
method of AGRegexMatch and recompile the framework. Maybe I shall try
it
sometimes when I come back to implement regexs in my app.
yup, that's a good idea.
thanks, ben.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.