mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
Added calls to GC.AddMemoryPressure() when unmanaged memory is allocated for ODE (helps the GC make better scheduling choices), and a call to GC.Collect() right before logins are enabled for a region. Although this doesn't change actual memory usage, it improves the reported usage from OpenSim and the operating system
This commit is contained in:
@@ -174,6 +174,9 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
|
||||
float[] result = getVertexListAsFloat();
|
||||
m_pinnedVertexes = GCHandle.Alloc(result, GCHandleType.Pinned);
|
||||
// Inform the garbage collector of this unmanaged allocation so it can schedule
|
||||
// the next GC round more intelligently
|
||||
GC.AddMemoryPressure(Buffer.ByteLength(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -223,6 +226,9 @@ namespace OpenSim.Region.Physics.Meshing
|
||||
|
||||
int[] result = getIndexListAsInt();
|
||||
m_pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned);
|
||||
// Inform the garbage collector of this unmanaged allocation so it can schedule
|
||||
// the next GC round more intelligently
|
||||
GC.AddMemoryPressure(Buffer.ByteLength(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user