Memory Usage Question

G

gwoodhouse

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
 
M

markspace

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?).....
 
G

gwoodhouse

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

Roedy Green

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top