• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

out of memory

Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Posts: 9615
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Platform Performance will help you gain an understanding of how to measure and compare performance.
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic