Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / October 2004

Tip: Looking for answers? Try searching our database.

outofmemoryException

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex - 08 Oct 2004 16:05 GMT
Hi,

I am accessing  Blob from Oracle database using
OleDbDataReader,ExecuteReader method.I am getting an outofMemoryException
when blob keeps on accessing and total size of all the blobs exceeds 1 GB.
When I profiled the application with PerfMon.exe,in the graph always Large
Object Heap Size,is going horizontally on top of Y-axis.Is it a MemoryLeak?

Following is code snippet.
while(reader.Read())

{

Byte[] buffer;

//checks BLOB

if(!reader.IsDBNull(ordinalBlob))

{

   buffer = new Byte[(reader.GetBytes(ordinalBlob, 0/*index*/,
null/*buffer*/, 0/*bufferIndex*/, int.MaxValue))];

   reader.GetBytes(ordinalBlob,0, buffer,0,buffer.Length);

}

}

Thanks

Alex
Mickey Williams [C# MVP] - 08 Oct 2004 17:40 GMT
You only have (generally speaking) a 2GB address space. Are you running out
of heap? One issue with the LOH is that free space is not compacted, so if
you're allocating huge gobs of memory and fragment the LOH, you can wind up
with a allocation request that can't be fulfilled. Also, the LOH heap does
not include any interop bytes. Also, my experiments on some perf issues that
I've worked on seems to indicate that the reported size of the LOH is the
maximum watermark, rather than a current snapshot (perhaps due to the LOH
not being compacted).

What do the other perf counters tell you? .NET CLR Memory/ # Bytes in all
heaps, tells you your current heap status in all generations including the
LOH.
Check the Process/Private Bytes perf counter, which is a counter that looks
at your process, rather than the .NET runtime only.

Another thing I've done is to use WinDBG and the SOS extension - you can get
a great deal of information about memory issues. You can also use SOS inside
Visual Studio, but I haven't encountered any nasty perf issues since I heard
that bit of news, so I have no real info there.

Signature

Mickey Williams
Author, "Visual C# .NET Core Ref", MS Press
www.neudesic.com
www.servergeek.com

> Hi,
>
[quoted text clipped - 30 lines]
>
> Alex
Alex - 14 Oct 2004 13:19 GMT
Thanks Williams

I have dumped my application's managed heap using WinDBG(scenario:with 10
numbers of 16MB LongRaw data). There is no big object is rooted to get
leaked.

Then I profiled the application with Performance Monitor for OutOfMemory
scenario.For #Bytes in All Heaps,the graph is going up and down regulary,but
Private Bytes keep growing and eventually I am getting the OutOfMemory
exception.Pretends memory leak happens in the native memory.

Is there any memory leak issue in OleDb provider, for Blob operations?

To avoid OleDb,tried with MS Oracle Provider.For big blobs I am getting
ORA-01406:fetched column value was truncated  exception.
And Oracle Data Provider does not support more than 32512 bytes.

Currently I have no other option other than OleDb to access the Long Raw
data.Please send the comments.

Thanks
Alex

> You only have (generally speaking) a 2GB address space. Are you running out
> of heap? One issue with the LOH is that free space is not compacted, so if
[quoted text clipped - 50 lines]
> >
> > Alex

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.