Re: How to set the compiler to handle thousand loops ?




tobleron wrote:
On Oct 31, 5:58 pm, RedGrittyBrick <RedGrittyBr...@xxxxxxxxxxxxxxxxx>
wrote:
tobleron wrote:
Hi,
Hi, I'm using NetBeans IDE 6.1 to develope my application. My
application works well when deals with loops of reading 52,000 lines
of waveform data. But it fails when reads 104,000 of waveform data.
How to set the IDE to handle multiple loops like this ? I'm using
FileOutputStream function, while-do, and ByteBuffer function in this
case. Please advise. Thank you in advance.
Please readhttp://www.catb.org/~esr/faqs/smart-questions.html

- Define "it fails".
- Where is your code?
- What makes you think an IDE places any restriction on loop size?


@All,

Here is the the error code shows by NetBeans IDE :

Caused by: java.lang.OutOfMemoryError: Java heap space
at ....

For mor detail, my code is to generating DICOM file which is contains
waveform data of ECG record. The waveform data source is a text file
that contains hundreds or even thousands lines of ECG signal. Each
line contains 12 ECG channels. So what my code do is :

- first : opens the text file BufferedReader function.
- second : uses FileOutputStream function to write the streamed bytes.
- third : reads line by line (by using scanner and loop function) then
split each line to get the 12 channels value.
- forth : switch to little endian encoding to write the channel value
bytes (DICOM using little endian encoding for the waveform value).

The third and forth steps are looped from the first line until the end
line of the text file.

I said : it fails, because the process is stopped and the IDE shows
error message above.

I thought the IDE can not handle thousands times of looping, because
the code works well in 52,000 lines data, but when I doubled the
lines, the process is stopped and the error message is occured. And it
was "out of memory".

So, I want to know, is there any way to make adjustment in IDE,

You don't need to.

may be
for buffer setting, or some thing like that ? I used 512 MB of RAM,
and I seek another possible ways other than "add more RAMs".

You probably need much LESS RAM if you fix your coding.

Please advise.

See Martin Gregorie's advice. With more or less the *same* *small* amount of memory usage you should be able to process 1 line, 1000 lines, 1000000 lines, 1000000000 lines or almost any number of lines (each containing twelve channel values).

Just make sure your FileOutputStream is being flushed periodically and that you are not "packratting" objects (http://mindprod.com/jgloss/packratting.html)


--
RGB
.



Relevant Pages

  • Re: How to set the compiler to handle thousand loops ?
    ... But it fails when reads 104,000 of waveform data. ... How to set the IDE to handle multiple loops like this? ... What makes you think an IDE places any restriction on loop size? ...
    (comp.lang.java.programmer)
  • Re: How to set the compiler to handle thousand loops ?
    ... I'm using NetBeans IDE 6.1 to develope my application. ... But it fails when reads 104,000 of waveform data. ... How to set the IDE to handle multiple loops like this? ... FileOutputStream function, while-do, and ByteBuffer function in this ...
    (comp.lang.java.programmer)
  • Re: How to set the compiler to handle thousand loops ?
    ... I'm using NetBeans IDE 6.1 to develope my application. ... But it fails when reads 104,000 of waveform data. ... How to set the IDE to handle multiple loops like this? ... FileOutputStream function, while-do, and ByteBuffer function in this ...
    (comp.lang.java.programmer)
  • Re: .NET MFC new class wizard problem
    ... I also experience this problem when using the class browser to create new ... It seems the IDE wants to check out all the ... the whole project first, ... > loops on to the next one. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Using with
    ... Second" then ran it compiled and in the IDE, the IDE results are similar to ... The benchmarking I did however showed that the loops (I chose) were ... insignificantly but measurably faster using With. ...
    (microsoft.public.vb.general.discussion)