Re: memory management
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 09:18:47 -0400
Thomas Kellerer wrote:
As far as I can tell, this will create huge strings with the complete
result set, as they are declared outside the loop (actually twice the
result set because one for the out_Record and one for the in_record).
Ingo Menger wrote:
Actually 4-fold, since at the end he does:
log += out_record + in_record;
//out.print(st);
out.print(log);
Just changing this will save 50% memory:
Actually even more than that, because all the intermediate strings are there from each iteration. Given n iterations, aren't there O(n^2) Strings generated?
--
Lew
.
- Follow-Ups:
- Re: memory management
- From: Ingo Menger
- Re: memory management
- References:
- memory management
- From: josh
- Re: memory management
- From: Thomas Kellerer
- Re: memory management
- From: josh
- Re: memory management
- From: Thomas Kellerer
- Re: memory management
- From: Ingo Menger
- memory management
- Prev by Date: Re: memory management
- Next by Date: Re: How to limit and change CPU and memory of a thread?
- Previous by thread: Re: memory management
- Next by thread: Re: memory management
- Index(es):
Relevant Pages
|