Results 1 to 2 of 2
  1. #1
    javaOrC is offline Member
    Join Date
    Jan 2011
    Location
    NewYork
    Posts
    13
    Rep Power
    0

    Default Memory pool in file handling?

    Hi,
    I have an issue with lots of memory allocation/freeing in my program because of which JVM GC gets pretty hectic after some time and that leads to huge delays in application run time.

    I guess it can be overcome by using a global memory pool of objects(separate pool for each object) which can be reused again and again. But I am currently using a cache for the objects and the cache manager loads objects from disk to memory using ObjectInputStream.readObject(). For such cases I do not have control on letting java reuse some object from my memory pool.

    Is there any workaround for this?

  2. #2
    d3n1s is offline Member
    Join Date
    Apr 2011
    Posts
    69
    Rep Power
    0

    Default

    Hi

    Just throwing ideas here but i often use thread pooling and connection pooling for the very same reason, avoid constant thread/connection creation/destruction and optimize memory usage and performance. Perhaps you could implement a stream pool to achieve the same results? You would only have to open let's say 5 streams at execution and constantly reuse them until the program is stopped.

Similar Threads

  1. File handling
    By Dayanand in forum New To Java
    Replies: 7
    Last Post: 03-23-2011, 08:31 AM
  2. File handling
    By Dayanand in forum New To Java
    Replies: 1
    Last Post: 03-22-2011, 08:07 PM
  3. File handling
    By Dayanand in forum New To Java
    Replies: 3
    Last Post: 03-22-2011, 05:20 PM
  4. File handling
    By Claude2005 in forum New To Java
    Replies: 17
    Last Post: 09-21-2010, 12:49 PM
  5. handling WAV file
    By zellazode in forum New To Java
    Replies: 1
    Last Post: 09-08-2009, 04:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •