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?

--
RGB

@All,

Here is the the error code shows by NetBeans IDE :

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

You would see the same error even running outside the IDE.

Just out of curiosity, why aren't you quoting the entire error message?

OOME means you haven't allocated enough memory for the process, or else you are wasting memory in your code (my bet). Allocate more memory or else fix the bug.

For mor detail, my code is to generating DICOM file which is contains

For more detail:
Check out, read thoroughly, and follow the advice of <http://sscce.org/>.

Why the heck do you ignore advice, then ask for more help?

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 :

SSCCE, please. Description is useless.

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

Gee, if we could only see the code we could tell you where your mistake is.

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

You said too little to let us help.

I thought the IDE can not handle thousands times of looping, because

Your problem has nothing to do with the IDE.

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

You are not releasing memory after each loop.

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

Nope.

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". Please
advise.

You got advice that you ignored.
<http://sscce.org/>

Generally speaking, your code is allocating memory that it never releases. Release unused objects and they will be collected, and you won't get the OOME.

<http://sscce.org/>
<http://sscce.org/>
<http://sscce.org/>

--
Lew
.



Relevant Pages

  • Re: "Mastering C Pointers"....
    ... all means go ahead and dive right into the C language. ... Memory is a separate unit which just stores bits. ... A pointer at the hardware level _is an integer_. ... since loops make your logic more much ...
    (comp.lang.c)
  • Re: Limitation with ActiveExplorer Selection?
    ... I've seen loops that worked correctly on my ... > machines cause out of memory errors on client's machines because of that. ... > since Outlook creates internal variables for each suboperator in the dots. ...
    (microsoft.public.outlook.program_forms)
  • Re: Best Performance File Compare: MD5/SHA1 or Byte-by-Byte Checking?
    ... you might want to use the method that loops ... the entire contents of the two files into memory. ... comparing the chunks, you are going to make the process much more efficient. ... What about MD5? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: "Mastering C Pointers"....
    ... > Memory is just a big array of bytes again. ... > (If you're not totally familiar with loops in general, ... My point was that for and while loops compile down to ... > organize this enormous stream of instructions ...
    (comp.lang.c)
  • Re: Limitation with ActiveExplorer Selection?
    ... RAM and virtual memory size. ... I've seen loops that worked correctly on my dev ... since Outlook creates internal variables for each suboperator in the dots. ... > Set candFolder = Application.ActiveExplorer.CurrentFolder ...
    (microsoft.public.outlook.program_forms)