This is a migrated thread and some comments may be shown as answers.

OutOfMemoryException

3 Answers 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jürgen
Top achievements
Rank 1
Jürgen asked on 02 Dec 2011, 06:29 PM
Hello, Telerik team!
we have an application which imports some data from one database to another.
we have Imported entity Test. It has some large CLOB columns.
when I read it from one database in cycle and try to write it to another db - after X committed records I occur an exception OutOfMemoryException.
In different situations count of sucessfull commited records is different. But generally this exception is after 100+ commited records!
What problem is it?
What can you suggest in this situation?
Should I add some code sample?
Exception message is:

Insert of '690134316-100490' failed: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes) ....................


Please answer as soon as possible. It is very urgently now.
Thanks!



3 Answers, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 05 Dec 2011, 04:31 PM
Hi Jürgen,

You should try performing the import in smaller batches where you dispose the context more often. This would help in freeing memory for data that is already imported. You could also send us your sample code so that we can verify it.

Best wishes,
Ady
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Accepted
IT-Als
Top achievements
Rank 1
answered on 05 Dec 2011, 05:50 PM
Hi Jürgen,

As a follow up to the suggestion by Ady:
I have just encountered the same thing, and my problem was not OA related.
I simply forgot to close my ADO.NET "readers" that read records from the source DB. Maybe this is your problem, too?

Regards

Henrik
0
Jürgen
Top achievements
Rank 1
answered on 07 Dec 2011, 08:19 AM
After some testing I see - it is our bug. We didn't free memory after usage some objects.
So, now it is closed.
Thanks!
Tags
General Discussions
Asked by
Jürgen
Top achievements
Rank 1
Answers by
Ady
Telerik team
IT-Als
Top achievements
Rank 1
Jürgen
Top achievements
Rank 1
Share this question
or