System.OutOfMemoryException on WCF Web Service with Telerik ORM

Thread is closed for posting
4 posts, 0 answers
  1. Heiko
    Heiko avatar
    20 posts
    Member since:
    Jan 2009

    Posted 21 Oct 2009 Link to this post

    Hi Telerik Team,

    I'm using ORM in combination with WCF Web Services and fixed already a lot of issues in this topic.

    Now I stuggle on a System.OutOfMemoryException when performing an import process where a lot of objects are beeing created.

    The effect is that the ASPNET_WP.EXE blows up to 1.4 GB and the exception will be thrown.

    I already tried to implement IDisposable and calling the Garbare Collector (GC.Collect()) in that responsable functions, but no effect.

    The Server is a QuadCore (C2Q) with 4 GB RAM. Even if there is more RAM free than 1,4 GB the exception is always thrown when the aspnet_wp.exe reaches 1.4 GB.

    What can I do to avoid these OutOfMemory issues?


    The exact exception message is:

    System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
    at
    OpenAccessRuntime.DataObjects.PersistenceManagerFactoryBase.
    CreatePersistenceMangerImp(StorageManger sm)
    at
    ....




    Thanks a lot !!!

    Heiko
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 23 Oct 2009 Link to this post

    Hello Heiko,

    Is it possible that you are adding a large amount of objects in a single transaction? You can try using the IObjectScope.Transaction.Flush() method at some points to flush the new and dirty objects to the database and clear the cache. Using more separate transactions would have the same effect as well. Please let us know if this helps.

    Greetings,
    Alexander
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Heiko
    Heiko avatar
    20 posts
    Member since:
    Jan 2009

    Posted 24 Oct 2009 Link to this post

    Hi Alexander,

    Thanks for your help. This is much appreciated!!

    I implemented this Scope.Transaction.Flush() in my generic functions. But without any change in behavior.

    Can this be an issue of the combination of WCF Web Services and Telerik ORM? Such like chaching issues?

    I really need a solution on this very quickly.

    Any help is very welcome!

    Thanks

    Heiko
  4. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 26 Oct 2009 Link to this post

    Hello Heiko,

    Many customers use Telerik OpenAccess ORM in a combination with WCF and such problems have not been reported. It seems that something does not get disposed. If you are using many IObjectScope instances, they should be explicitly disposed at the end. If you are not doing this, it may lead to similar behavior.
    I would suggest you to take a look at our N-tier WCF example and see the differences between your and our approach. There could be something small but crucial.
    At this point we are not able to dig any further into the problem without additional information. Please send us some code from your import methods, so we can check if the object scope is used correctly and try to represent the behavior locally.

    Sincerely yours,
    Alexander
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top