locked
How to Release Memory while moving and inserting document in database. RRS feed

  • Question

  • User-1926462429 posted

    Hi friends,

                     I have an utility which upload 1GB+ documents to database. i also keep track about the documents which are inserted in to database by moving inserted document to a separate location.

    MY Process is as bellow:

    1. Read documents from a Folder

    2. Insert document to database

    3. Move inserted document to another Folder.

    When i run my utility i get error indicating not enough memory. i even monitored that when my Utility runs memory is decreasing conterminously.  

    when i close my utility all the memory is recovered. i have properly disposed and used using() in my code to dispose object it self. 

    My question is: Does memory is release when process killed or can u automatically release memory while doing operation. 

    Thanks & Regards

    Gireesh Painuly

    Friday, February 24, 2012 1:45 AM

All replies

  • User197322208 posted

    read by chunks -file by file and reclaim Memory with GarbageCollector.

    Friday, February 24, 2012 5:04 AM
  • User-1926462429 posted

    hi 

    ignatandrei,

    I have tired some thing as in bellow link: 

    http://gireeshpainuly.blogspot.in/

    it works fine. but i found that when i track the virtual Memory of the system it get increase while physical memory get increasing and decreasing based on the memory released.

    Is it Correct way or something else should be implemented. 

    Thanks & Regards

    Gireesh Painuly. 

    Monday, February 27, 2012 4:32 AM