huge recursive and memory leaking?

Discussion in 'Java' started by jojo, Sep 7, 2005.

  1. jojo

    jojo Guest

    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.
    jojo, Sep 7, 2005
    #1
    1. Advertising

  2. 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'
    Andrew Thompson, Sep 7, 2005
    #2
    1. Advertising

  3. jojo

    jojo Guest

    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.
    jojo, Sep 7, 2005
    #3
  4. jojo

    jojo Guest

    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
    jojo, Sep 7, 2005
    #4
  5. jojo

    Roedy Green Guest

    On 7 Sep 2005 11:32:59 -0700, "jojo" <> 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.
    Roedy Green, Sep 7, 2005
    #5
  6. jojo

    jan V Guest

    "jojo" <> wrote in message
    news:...
    > 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...
    jan V, Sep 8, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Andrews

    Leaking memory when writing to URL

    Simon Andrews, Jan 6, 2006, in forum: Java
    Replies:
    6
    Views:
    3,249
    Robert Klemme
    Jan 6, 2006
  2. Sam L.
    Replies:
    0
    Views:
    261
    Sam L.
    Sep 24, 2005
  3. Sigmathaar

    Memory leaking

    Sigmathaar, Dec 20, 2005, in forum: C++
    Replies:
    6
    Views:
    593
    Axter
    Dec 20, 2005
  4. zl2k
    Replies:
    6
    Views:
    756
    mlimber
    Apr 3, 2006
  5. Replies:
    3
    Views:
    490
Loading...

Share This Page