We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Question about a debug output message I am getting

I was in a form that has a grid that has a lot of loading and reloding going on depending on data in a dropdowncombo box. One time when I was closing the form it was taking forever like it was locked up or I had an error. It finally came back after like 10 or 20 seconds and in the output debug window it had the following over and over and over. Any idea on what could cause this???


Detected too many items in volatile date hashtable. Reducing GridVolatileData.forceGcCollect to a value below 83
System.InvalidOperationException: Hashtable insert failed. Load factor too high.
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.set_Item(Object key, Object value)
at Syncfusion.Windows.Forms.Grid.GridVolatileData.SetItem(GridCellPos cell, GridStyleInfo style)
Detected too many items in volatile date hashtable. Reducing GridVolatileData.forceGcCollect to a value below 83
catched at Syncfusion.Windows.Forms.Grid.GridVolatileData.SetItem(GridCellPos cell, GridStyleInfo style) in :line 0
The thread '' (0xf70) has exited with code 0 (0x0).

6 Replies

HA haneefm Syncfusion Team October 4, 2007 11:17 PM UTC

Hi Philip,

Below is a forum thread that discuss with the similar issue.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=32767

When you use the debug builds for Essential Grid, you will get a trace message that indicates how many items are in the volatile data cache.

Here is the code for SetItem

public void SetItem(GridCellPos cell, GridStyleInfo style)
{
try
{
if (data.Count >= forceGcCollect)
GC.Collect();
#if DEBif (data.Count > maxDataCount)
{
Console.WriteLine("VolatileData HashTable: " + data.Count.ToString());
maxDataCount = data.Count + data.Count/10;
// let's just show a Trace statement for larger increases ...
}
#endif
data[cell] = new WeakReference(style);
}
catch (InvalidOperationException ex)
{
// should be InvalidOperation_HashInsertFailed=Hashtable insert failed. Load factor too high.
TraceUtil.TraceExceptionCatched(ex);
Trace.WriteLine("Detected too many items in volatile date hashtable. You should set GridVolatileData.forceGcCollect to a value below " + data.Count.ToString());
TraceUtil.TraceCurrentMethodInfo("Hashtable count: ", data.Count);GC.Collect();
TraceUtil.TraceCurrentMethodInfo("Hashtable count after GC.Collect: ", data.Count);
data[cell] = new WeakReference(style);
}
}


The exception itsself is handled by an exception handler and resolved when it happens. Basically what I need to do is force a call to GC.Collect.

If you have source code than you could change the value for forceGCCollect to be less than what is written out.

The error can happen in rare cases when more items are cached than the Hashtable can hold. This is when you do a extensive operation and GC is not called for a while or when you keep references to the style objects and therefore the GC can not release the objects.

Try checking this issue in any one of our latest version. Please refer the link below for the download details of the latest version.
http://www.syncfusion.com/downloads/latestversion/default.aspx

FYI, we have added many new features and samples to our latest version. Performance of gridgroupingcontrol has been increased.

Best regards,
Haneef


PB Philip Bishop October 5, 2007 01:28 PM UTC

Ok I am totally confused. After reading that link you posted I am even more confused. Yes we can on to style objects. I have a grid that can be 98 cols by 364 rows. I load it in two sections and then if the user changes a field in a dropdown I reaload it again. They can do this over and over. I set up all the styles in the IDE. We dont have the option of going to your new version yet because that always requires us to retest every app we have and we dont have that kind of time right now. So I need help in fixing this with 4.2. So what exactly does the code that Stefan put in the link you gave do? Also can you give me that code in VB? Thanks.


PB Philip Bishop October 10, 2007 12:39 PM UTC

Any ideas on this??


PB Philip Bishop October 16, 2007 12:39 PM UTC

Any thoughts on this??


PB Philip Bishop October 22, 2007 01:19 PM UTC

I have tried to get another answer on this 3 times now and nobody has even responded to it!!


HA haneefm Syncfusion Team October 22, 2007 06:29 PM UTC

Hi Philip,

Our apologies for the delay in response.

Here is a conversion of the C# code for the link I posted on 10/4/2007 7:17:40 in VB.

Private Sub AdjustForceGcCollect(ByVal gridModel As Syncfusion.Windows.Forms.Grid.GridModel, ByVal NewValue As Integer)

Dim volatileData As GridVolatileData = gridModel.VolatileData
If Not volatileData Is Nothing Then

Dim te As Type = Type.GetType(volatileData.GetType().AssemblyQualifiedName)
Dim fi As System.Reflection.FieldInfo = te.GetField("forceGcCollect", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
If Not fi Is Nothing Then
fi.SetValue(volatileData, NewValue)
End If
End If

End Sub

Above code snippet is just changed the value for forceGCCollect to be less than what is written out in our source code. The changed value is forced to call the GC.Collect() method in the SetItem method. Please refer my last reply for the SetItem method code snippet.

This error can happen in rare cases when more items are cached than the Hashtable can hold. This is when you do a extensive operation and GC is not called for a while or when you keep references to the style objects and therefore the GC can not release the objects.

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon