Re: Memory Allocation in Java
- From: Christopher Smith <csmith@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 26 Aug 2006 12:13:47 -0500
Patricia Shanahan <pats@xxxxxxx> wrote in
news:5vZHg.1553$xQ1.129@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
Christopher Smith wrote:
Hi All -
Problem: I have a large array of floating point numbers I need to
look for. These results come from a brut-force grid search, where the
coordinates (x,y) are non-parametric test results.
The problem is that the length of x and y, and thus the size of the
grid is quite large. The length is a minimum of 120,000 both
directions on the grid, for a total of 14,400,000,000 possible
combinations. Which obviously consumes a lot of memory -- somewhere
on the order of 500 MB, if 32-bit floating point.
I'm trying to think through the best way to handle this. Currently,
I'm setting up an array Array[][] results = new
Array[120000][120000].
Questions
When intitailizing the array, the ide usually hangs. Is the compiler
trying to find contingous memory?
Is there a better way to handle this the results? If I initialized a
vector of length 14.4 million, would that be faster? Any ideas are
greatly appreciated.
Thanks, chris
If it were a contiguous memory issue, that would go away if you
initialized each array separately - remembering you really have a
120,000 element array whose elements are references to 120,000 element
arrays of float.
Do you have enough swap space in the machine?
Do you have problems if you run it outside the IDE?
Patricia
Gotcha. Let me try it first with the right compiler flag (please see my
response to Andrew).
If that doesn't help, I think what you're saying is that I should
initialize the array along the X axis and then intiatialize an array
within each "row" -- for lack of a better term. Am I getting this right?
Should have plent of mem. Over 1GB of ram and healthy swap space
(windows xp prof is the current platform but the app will run regulary on
redhat.)
Also, I'll try outside the IDE.
.
- Follow-Ups:
- Re: Memory Allocation in Java
- From: Patricia Shanahan
- Re: Memory Allocation in Java
- References:
- Memory Allocation in Java
- From: Christopher Smith
- Re: Memory Allocation in Java
- From: Patricia Shanahan
- Memory Allocation in Java
- Prev by Date: Re: Memory Allocation in Java
- Next by Date: Adding to a byte array
- Previous by thread: Re: Memory Allocation in Java
- Next by thread: Re: Memory Allocation in Java
- Index(es):
Relevant Pages
|
|