the inefficiency of noncontiguous data - why?
- From: wittle <w@xxxxx>
- Date: Sat, 29 Sep 2007 14:44:45 -0400
I noticed that breaking up a large array into 2 pieces results in a much higher memory usage for my program. Example:
A program with:
float[] a = new float[32000000];
uses 138MB of memory on my system.
But a program with:
float[] b = new float[16000000];
float[] c = new float[16000000];
uses 187MB of memory, even though it's the same amount of data.
Why is this? My heap size is 800MB.
.
- Follow-Ups:
- Re: the inefficiency of noncontiguous data - why?
- From: Roedy Green
- Re: the inefficiency of noncontiguous data - why?
- From: wittle
- Re: the inefficiency of noncontiguous data - why?
- From: Daniel Dyer
- Re: the inefficiency of noncontiguous data - why?
- Prev by Date: java tips
- Next by Date: Re: the inefficiency of noncontiguous data - why?
- Previous by thread: java tips
- Next by thread: Re: the inefficiency of noncontiguous data - why?
- Index(es):
Relevant Pages
|
|