avoid a data copy

0.9.1.0-post-fixes
UbitUmarov 2018-12-03 10:39:54 +00:00
parent 79234795fd
commit 66f3c6c730
2 changed files with 9 additions and 7 deletions

View File

@ -48,12 +48,9 @@ namespace OpenSim.Framework.Monitoring
Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
sb.AppendFormat(
"Last heap allocation rate : {0} MB/s\n",
Math.Round((MemoryWatchdog.LastHeapAllocationRate * 1000) / 1024.0 / 1024, 3));
sb.AppendFormat(
"Average heap allocation rate: {0} MB/s\n",
Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3));
"Heap allocation rate (last/avg): {0}/{1}MB/s\n",
Math.Round((MemoryWatchdog.LastHeapAllocationRate * 1000) / 1048576.0, 3),
Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1048576.0, 3));
Process myprocess = Process.GetCurrentProcess();
// if (!myprocess.HasExited)

View File

@ -843,7 +843,10 @@ namespace OpenSim.Framework.Servers.HttpServer
if (!response.SendChunked && response.ContentLength64 <= 0)
response.ContentLength64 = buffer.LongLength;
response.OutputStream.Write(buffer, 0, buffer.Length);
//response.OutputStream.Write(buffer, 0, buffer.Length);
response.RawBufferStart = 0;
response.RawBufferLen = buffer.Length;
response.RawBuffer = buffer;
}
// Do not include the time taken to actually send the response to the caller in the measurement
@ -851,7 +854,9 @@ namespace OpenSim.Framework.Servers.HttpServer
// server
requestEndTick = Environment.TickCount;
buffer = null;
response.Send();
response.RawBuffer = null;
}
catch (SocketException e)
{