DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Heap Clearing

  1. #1
    Join Date
    Jun 2005

    Heap Clearing

    We are using jdk1.5 for our development. We have a Heap memory issue when our application is processing huge size of files. we are setting our JVM with the following options.
    java -Djava.class.path= -Xss1024k -Xms512m -Xmx512m -Xmn100M
    -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy
    Our application is made for doing continues processeing by taking the input files and generateing the output in another format. In this scenario our heap size also keep growing and reaching the maximum heap limit (512 MB in this case). After reaching this maximum our application stops processing. We tried to clear the memory using gc(Garbage collection) through JAVA but still we found the heap memory is cleared but not released. Is there any other way to resize/clear the heap memory. Please let us know if you have any solutions.

  2. #2
    Join Date
    Nov 2004
    I'm no expert in heaps but I would have had a look at your memory strategy here.
    I've done something similar: we continously loaded huge spreadsheets, parsed/checked
    them and grinded them it into a database.

    The file load was done using a byte buffer that was set to an initial and big size, this
    buffer was reused until a file that required a bigger buffer came along. At that point
    the buffer was reallocated to accomodate the new size requirement. This method
    kept the memory requirements comfortably low.
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.