Re: Memory Allocation in Java



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.
.



Relevant Pages

  • Re: Virtual grid
    ... just ditch the array & load the data directly to the grid. ... Populating the grid from a file will be somewhat slower than from an array (memory), ... > want to display it in a flexgrid control. ...
    (microsoft.public.vb.controls)
  • Re: How do I use a parameter/variable/string literal as an identifier?
    ... Not an actual grid, just a bunch of text boxes ... corresponding member of a boolean array (there is one array for each ... but I would rather learn a new language ...
    (comp.lang.pascal.delphi.misc)
  • Re: Virtual grid
    ... do not display all the digits after the decimal point. ... Besides, if I have numbers of type double, each element of the array only ... to the grid. ...
    (microsoft.public.vb.controls)
  • Re: MSHFlexgrid displayed value
    ... data, one for my array, and one for the grid, which means using double the ... >> get the format string, and display the value to the user. ...
    (microsoft.public.vb.controls)
  • Re: Memory Allocation in Java
    ... 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 are non-parametric test results. ... Which obviously consumes a lot of memory -- somewhere on the order of 500 MB, if 32-bit floating point. ... When intitailizing the array, the ide usually hangs. ...
    (comp.lang.java.help)