diff options
author | John Hurliman | 2009-10-26 15:52:59 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-26 15:52:59 -0700 |
commit | 119cf80e13e9fccea30147e3274f5d44958248b2 (patch) | |
tree | 4eddb70be6dc92ea7a8de05140d03c8b8529e13b /OpenSim/Region/Physics/Meshing/Mesh.cs | |
parent | No need to create dupe TriMeshData for ODE. A previous patch created a dictio... (diff) | |
download | opensim-SC_OLD-119cf80e13e9fccea30147e3274f5d44958248b2.zip opensim-SC_OLD-119cf80e13e9fccea30147e3274f5d44958248b2.tar.gz opensim-SC_OLD-119cf80e13e9fccea30147e3274f5d44958248b2.tar.bz2 opensim-SC_OLD-119cf80e13e9fccea30147e3274f5d44958248b2.tar.xz |
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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Mesh.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 4c3cf33..e8a3e19 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs | |||
@@ -174,6 +174,9 @@ namespace OpenSim.Region.Physics.Meshing | |||
174 | 174 | ||
175 | float[] result = getVertexListAsFloat(); | 175 | float[] result = getVertexListAsFloat(); |
176 | m_pinnedVertexes = GCHandle.Alloc(result, GCHandleType.Pinned); | 176 | m_pinnedVertexes = GCHandle.Alloc(result, GCHandleType.Pinned); |
177 | // Inform the garbage collector of this unmanaged allocation so it can schedule | ||
178 | // the next GC round more intelligently | ||
179 | GC.AddMemoryPressure(Buffer.ByteLength(result)); | ||
177 | 180 | ||
178 | return result; | 181 | return result; |
179 | } | 182 | } |
@@ -223,6 +226,9 @@ namespace OpenSim.Region.Physics.Meshing | |||
223 | 226 | ||
224 | int[] result = getIndexListAsInt(); | 227 | int[] result = getIndexListAsInt(); |
225 | m_pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned); | 228 | m_pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned); |
229 | // Inform the garbage collector of this unmanaged allocation so it can schedule | ||
230 | // the next GC round more intelligently | ||
231 | GC.AddMemoryPressure(Buffer.ByteLength(result)); | ||
226 | 232 | ||
227 | return result; | 233 | return result; |
228 | } | 234 | } |