aspose file tools*
The moose likes I/O and Streams and the fly likes out of memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "out of memory" Watch "out of memory" New topic
Author

out of memory

Howie Jiang
Greenhorn

Joined: Aug 25, 2003
Posts: 26
I am processing very big files.. I get out of memory exception when I process every 1000 records in the file.. but processing 100 records is okay. but procesing every 100 records is using longer time than processing every 10 records.. I get two questions here.

1. how can I know the memory will be used out and can do some detection before it throw me an exception?

2. Why my processing every 10 record at a time is faster? how can I get the best performance..

Thanks very much!
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Can you clarify what "processing every 10/100/1000 records" means? As for memory usage, java.lang.Runtime has total/max/freeMemory() methods that you could monitor as you process records.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8895
    
    8

Java Platform Performance will help you gain an understanding of how to measure and compare performance.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: out of memory