Re: memory management
- From: Ingo Menger <quetzalcotl@xxxxxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 06:41:51 -0700
On 31 Okt., 14:18, Lew <l...@xxxxxxxxxxxxx> wrote:
Thomas Kellerer wrote:
Ingo Menger 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).
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.
Sure, but the intermediates can be collected. But the "log +=
out_record + in_record" just doubles (at least) the need for
*accessible* memory in one sweep.
Given n iterations, aren't there O(n^2) Strings generated?
Certainly. Wich will give the gc a hard time. The program should not
only use huge amounts of memory but also many ticks in the gc.
.
- 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
- Re: memory management
- From: Lew
- memory management
- Prev by Date: Re: To static or not to static
- Next by Date: Re: database update Combobox
- Previous by thread: Re: memory management
- Next by thread: Re: memory management
- Index(es):
Relevant Pages
|