.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

CLR Inside Out: Large Object Heap Uncovered

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

This month CLR Inside Out reveals the secrets behind the Large Object Heap-what's there, when it's released, how the garbage collector handles the objects there.

Maoni Stephens

MSDN Magazine June 2008

View Complete Post

More Related Resource Links

CLR Inside Out: Profiling the .NET Garbage-Collected Heap


In this article, the authors complete the picture for Garbage Collected (GC) heap related memory issues by providing step-by-step instructions on using the CLR Profiler for .NET GC heap memory investigations.

Subramanian Ramaswamy, Vance Morrison

MSDN Magazine October 2009

CLR Inside Out: Managing Object Lifetime


Although the .NET Framework provides a managed execution environment, it is important to consider object lifetime management and write code that uses and releases resources correctly. The CLR team shows you how.

Tim Fischer

MSDN Magazine November 2007

Cannot access Label inside Repeater - "Object reference not set..."


I have a button on a page with a Repeater and an ObjectDataSource. To give credit where credit is due, the Repeater's paging functionality is courtesy of ScottGu. (However, I'm using ASP.NET 4.0 and SQL Server 2008, as opposed to ASP.NET 2.0 and SQL Server 2005.)

Anyway, in the button's click event, I need to access the Text property of a Label that's inside the Repeater because it's used as an input parameter in a stored procedure. I'm getting a NullReferenceException when trying to access the Label's Text property. I have researched this error and have tried a few different solutions (involving FindControl and the Repeater's ItemDataBound event), but I haven't been able to get it to work. Any suggestions, in VB or C#, would be greatly appreciated. The code is below.


<asp:Repeater ID="rptText" runat="server" DataSourceID="tbsDataSource">
<table width="100%" cellspacing="1">
<%-- some rows removed for brevity --%>

How to: Serialize Hashtable contained inside another object that is serialized as an array of object

Update:  I've added the entire program in a single block of C# text near the end of these posts that can be placed into a C# Program.cs file of a console project.   I have a class called MyHashtable that inherits from Hashtable and implements IXmlSerializable.  MyHashtable is contained inside another object called MyObject and I need to xml serialize an array of MyObject[].  Whenever I xml deserialize, the hashtable is deserialized, but only 1 of MyObjects from the MyObject[] array is deserialized.  The ReadXml uses "while (reader.NodeType != XmlNodeType.EndElement)" so I don't think the reader is consuming all of the xml internally.   Does anyone know why this is happening?  Thanks.    

How to create an extremely large array/object (> 2 GB) without using jagged arrays ?

Hello,I had implemented a matrix scaling algorithm in Java (64-bit) for a university project and have now implemented the code in C# with .NET 3.5 64-bit. One of the operations I did in Java was creating a rectangular array with double[][] = ... (in C# this is a jagged array!) to store a symmetric matrix which is used as input for the algorithm. Since I was using matrices with n up to 30720, memory usage for the single matrix object was around 8 GB in it's maximum and with matrix multiplication around 20 GB.So... now I implemented this in C# and I am shocked to see that double[,] (rectangular arrays) can only be 2 GB in size even on 64-bit! That means that for matrices with n larger than ~15000 I will get OutOfMemory Exceptions although there is a huge amount of free memory (I have two quad core systems with 12 GB and 24 GB Ram). When I use jagged arrays in C# (i.e. double[][]) I can create larger matrices. That is because I have one small array with the size of the row number (i.e. n) and then for each row an array of size n, but they are all single objects so I don't reach the 2 GB per object limit. The problem with jagged arrays is that they are horribly slow for matrice calculations compared to rectangular arrays and even slower compared to single dimension arrays.Actually I intended to rewrite my code and simulate the matrices in single arrays (see sample code below) bec

Cannot send List inside of Dictionary

List<string> receivers = new List<string>(); foreach (object item in listBoxControl1.SelectedItems) receivers.Add((string)item); Dictionary<string, object> inArgs = new Dictionary<string, object>(); inArgs.Add("Receivers", receivers); inArgs.Add("Sender", client.name); inArgs.Add("Message", memoEdit2.Text); inArgs.Add("IsGuaranteedDelivery", true); inArgs.Add("DataType", TransmitToClientDataType.ChatMessage); if (service != null) service.AddTask("orion_send", inArgs); There is an error with serialization at last string because List<string> object. I tryed to send List<T> object via WCF, it's succesfull. But why there are problems with List<T> included to Dictionary?

page inside update panel doesn't refresh the session object after postback of any control



I have many controls like dropdown, radiobuttonlist, etc on my page and I put all these controls inside the update panel so that the page doesn't look to be posting back when something is selected. Now the working on the page is very smooth. But the session object isn't getting refreshed even if I postback to the server and as a result even if the users are working on the page they are being sent to the login screen after 20 mins.

Is there anyway where I could put all the controls in update panel and still refresh the session after any postback(dropdown selection)

Any help is greatly appreciated.

Thanks in advance

Object Value lost in script component inside for loop container

Hi All,

I need your expert advice here,

I have 5000 records to transform into csv file and due to the application limitation, the upload module to upload those 5000 records only can be done by batch of 100-200 record at one time.

Because of this, i try to use for loop to split the records into a few files e.g EE_1.csv, EE_2.csv.

The records was retrieved and saved into an object variable (ResultSet) before entering the For Loop flow

The issue i encounter, when it was on the 1st loop everything was fine, it is manage to generate X Records i specified but when it go for 2nd loop, the ResultSet is returning 0 Records..when the actual total records is 5000

Anyone can help this newbie what are the mistakes i made ?

The logic is something like

Public Overrides Sub CreateNewOutputRows()
oledbAdapter = New OleDb.OleDbDataAdapter
dataTable = New DataTable

oledbAdapter.Fill(dataTable, Me.Variables.resultset)
StartPoint = Me.Variables.FilesNumber 'To know which row to start
StartPoint = (StartPoint - 1) * Me.Variables.MaxRecord
EndPoint = (StartPoint + Me.Variables.MaxRecord) - 1

If dataTable.Rows.Count - 1 < EndPoint Then
EndPoint = dataTable.R

large object "out of memory"


We've read a number of MSDN articles, blogs, and forum posts.  But we cannot find a problem or explanation that seems to match what we are seeing.

In a certain configuration our application allocates various arrays of 40 or 80 Mb.  At one point we have about 500 Mb allocated then the app asks for an 80 Mb array - an out of memory exception is thrown.  But, according to a memory analysis tool and perfmon, there is over 1 Gb physical memory available (not to mention an additional 4 Gb in the page file)

We are completely confused as to why this memory allocation fails.  It seems to make no sense.

Any ideas?  TIA.

lock an object to multithreads by using lock inside the object's class..



I have a main program that holds static object.

The program launches multi-threads. all of this threads access the same static objec.

Problem is that I don't wish to allow access the same object at the same time for multuiple threads.

I wish to use LOCK inside the object....inside the class....and not write LOCK in the threads. this is frustrating.

is it possible?

How do I do that?

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

C# Object Oriented Programming

So far in C# Essentials we have looked at the basics of programming in C# such as variable types and flow control. Although it would be possible to write a functional program using these techniques, there is much more to becoming a proficient C# programmer. C# is, above all, an object oriented programming language and as such any C# programmer will be expected to create object-oriented applications using this language.

Object Oriented Programming

Four core concept of OOP Object Oriented Programming. 1.Inheritance, 2.Polymorphism, 3.Abstraction and 4.Encapsulation

Object-Oriented Programming Concepts

This is the first in a series of articles describing the use of object-oriented programming techniques as implemented by the C# programming language. This series follows the C# Fundamentals tutorial that beginners are advised to read first.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend