Memory Usage Question

Discussion in 'Java' started by gwoodhouse@gmail.com, Oct 13, 2010.

  1. Guest

    Hi Guys,

    Do any of you know if the size of a file matters when keeping a file
    handle open within Tomcat?

    out logging software is writing to files that are 4gb+ and its getting
    out of memory exceptions. It could be unrelated i was just wondering
    if the size of the file being written to effects the memory allocation
    within the jvm?

    Thanks

    Graeme
     
    , Oct 13, 2010
    #1
    1. Advertising

  2. markspace Guest

    On 10/13/2010 8:08 AM, wrote:

    > Do any of you know if the size of a file matters when keeping a file
    > handle open within Tomcat?
    >
    > out logging software is writing to files that are 4gb+ and its getting
    > out of memory exceptions.



    I don't think it should matter, not the way you are thinking. However
    in general a 4 gigabyte file is an unwieldy thing, I think you should be
    rotating your logs more often.

    Try saving and replacing the large log file so that you start fresh with
    a new one, see if the problems go away. I bet they don't.

    Unless you have something in the code base that tries to read in the
    whole file (do you do regex searches of your own logs from within
    Tomcat?).....
     
    markspace, Oct 13, 2010
    #2
    1. Advertising

  3. Guest

    On Oct 13, 5:18 pm, markspace <> wrote:
    > On 10/13/2010 8:08 AM, wrote:
    >
    > > Do any of you know if the size of a file matters when keeping a file
    > > handle open within Tomcat?

    >
    > > out logging software is writing to files that are 4gb+ and its getting
    > > out of memory exceptions.

    >
    > I don't think it should matter, not the way you are thinking.  However
    > in general a 4 gigabyte file is an unwieldy thing, I think you should be
    > rotating your logs more often.
    >
    > Try saving and replacing the large log file so that you start fresh with
    > a new one, see if the problems go away.  I bet they don't.
    >
    > Unless you have something in the code base that tries to read in the
    > whole file (do you do regex searches of your own logs from within
    > Tomcat?).....


    Yeah i know the log files are stupidly large.

    Unluckily its "On someone else's to do list". Meaning i don't get to
    go in and fix it even though its a 2 minute job. Oh well.

    As for regexing the file... no i don't think so... or i would hope
    not.......
     
    , Oct 13, 2010
    #3
  4. Roedy Green Guest

    On Wed, 13 Oct 2010 08:08:41 -0700 (PDT), ""
    <> wrote, quoted or indirectly quoted someone who
    said :

    >Do any of you know if the size of a file matters when keeping a file
    >handle open within Tomcat?


    For FAT it has to keep the fat entries resident. For NTFS it has to
    keep the extent table resident. In general if the file is defragged
    it will take less RAM to read it since the extent table will be
    shorter. However, those tables live in the OS space, not Java space.
    See http://mindprod.com/jgloss/profiler.html for a tool to find out
    what is eating up your Java RAM.

    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    Microsoft has a new version out, Windows XP, which according to everybody is the "most reliable Windows ever." To me, this is like saying that asparagus is "the most articulate vegetable ever."
    ~ Dave Barry
     
    Roedy Green, Oct 14, 2010
    #4
    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. metfan
    Replies:
    2
    Views:
    4,855
    Robert Olofsson
    Oct 21, 2003
  2. hvt
    Replies:
    0
    Views:
    1,215
  3. hvt
    Replies:
    0
    Views:
    1,487
  4. Krist
    Replies:
    8
    Views:
    6,531
    Arne Vajhøj
    Feb 10, 2010
  5. MrsEntity
    Replies:
    20
    Views:
    482
Loading...

Share This Page