Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > huge recursive and memory leaking?

Reply
Thread Tools

huge recursive and memory leaking?

 
 
jojo
Guest
Posts: n/a
 
      09-07-2005
hi,

I have a program which loads the whole file system and write to the
corresponding database tables. I'm using a recursive to traverse the
file system and do the database mapping. but very time, the program
stopped randomly without exception returned. I wonder is that because
of the memory leaking? does JAVA return memory leaking exception?
thanks.

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      09-07-2005
On 7 Sep 2005 11:11:24 -0700, jojo wrote:

> I have a program


SSCCE? <http://www.physci.org/codes/sscce.jsp>

> ..which loads the whole file system


Do you mean the directory and file *names*, or 'the files'
on the filesystem?

>...and write to the
> corresponding database tables. I'm using a recursive to traverse the
> file system and do the database mapping.


Are you retaining refrences to what you have already written?

>..but very time, the program stopped randomly


If it is 'every time', that sounds 'pretty reliable',
rather than 'randomly'.

As to exactly where the program bombs, do you do
output of where you are up to?

>..without exception returned.


Some 'Exceptions' are *Error*s.

>..I wonder is that because of the memory leaking?


Well, I wouldn't go blaming the dog for this one.

>..does JAVA return memory leaking exception?


OutOfMemoryError, you need to ..

try {
// do big stuff...
} catch(OutOfMemoryError oome) {
// choices are very limited here, but
// you can usually do a few ticks to
// gain enough memory to warn the user
// the program is about to crash.
}
....

HTH

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Black Betty had a baby. Damn thing gone crazy.."
Leadbelly 'Looky Looky Yonder'
 
Reply With Quote
 
 
 
 
jojo
Guest
Posts: n/a
 
      09-07-2005
thanks for your reply. I use File in Java to do the recursive and
mapping the corresponding information to my database. ' stop randomly'
means it stops at uncertain point. sometimes the records in database
are add up to more than 50,000 and sometimes only more than 10,000.

 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      09-07-2005
B.T.W i 'm running the program within TOMCAT, is that the cause to it?
or i'd better run such huge stuff out of these AS. thanks

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-07-2005
On 7 Sep 2005 11:32:59 -0700, "jojo" <(E-Mail Removed)> wrote or
quoted :

>thanks for your reply. I use File in Java to do the recursive and
>mapping the corresponding information to my database. ' stop randomly'
>means it stops at uncertain point. sometimes the records in database
>are add up to more than 50,000 and sometimes only more than 10,000.


do you by any change go into an infinite loop waiting for a locked
file?
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
jan V
Guest
Posts: n/a
 
      09-08-2005

"jojo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> B.T.W i 'm running the program within TOMCAT, is that the cause to it?
> or i'd better run such huge stuff out of these AS. thanks


If you use a sensible development methodology, then you would already have a
way to test that particular aspect of your program without having to start
Tomcat. As you're finding out now, being able to test things independently
from the bulk of a system's complexity can help you when debugging things...


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recursive functions Vs Non-recursive functions - performance aspect vamsi C Programming 21 03-09-2009 10:53 PM
Memory error due to the huge/huge input file size tejsupra@gmail.com Python 3 11-20-2008 07:21 PM
Two recursive calls inside of a recursive function n00m C++ 12 03-13-2008 03:18 PM
Huge Memory Load for reading into memory rahulthathoo Perl Misc 6 11-10-2006 05:16 PM
Huge memory and new builds Dennis Gordon Windows 64bit 10 09-01-2005 07:24 PM



Advertisments