Out of memory using ResultsTable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Out of memory using ResultsTable

fiatlux
Hi,

I'm trying to display some results in a ResultsTable, but I get very fast out of memory, just by adding 18 empty columns. For instance :

ResultsTable results = new ResultsTable();
for (int i=0; i<18; i++) {
        results.addColumns();
}

I get the message "<Out of memory>" in the log. Is this normal? Does it has something to do with ResultsTable being RAM resident? Or are they disk resident?... Well, I guess I should be able to add more columns than just 18, right? Does someone know how to solve this?
(sorry for my English)

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Out of memory using ResultsTable

Rasband, Wayne (NIH/NIMH) [E]
On Dec 18, 2010, at 6:32 AM, fiatlux wrote:

> Hi,
>
> I'm trying to display some results in a ResultsTable, but I get very fast
> out of memory, just by adding 18 empty columns. For instance :
>
> ResultsTable results = new ResultsTable();
> for (int i=0; i<18; i++) {
> results.addColumns();
> }
>
> I get the message "<Out of memory>" in the log. Is this normal? Does it has
> something to do with ResultsTable being RAM resident? Or are they disk
> resident?... Well, I guess I should be able to add more columns than just
> 18, right? Does someone know how to solve this?
> (sorry for my English)

Use the the addValue(String,double) method to display results in the Results table. There is an example at

    http://imagej.nih.gov/ij/plugins/sine-cosine.html

The addValue() method automatically adds columns to the table as needed. The addColumns() method doubles the number of columns so calling it 18 times would result in a table with 150^18 columns!

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: Out of memory using ResultsTable

fiatlux
Ooookay ...
No wonder I was out of memory
I couldn't find any description of the addColumns function, so I just assumed it added one column...
Thanks a lot!