summaryrefslogtreecommitdiff
path: root/csharp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-08-05 11:11:41 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-08-05 11:11:41 +0200
commit2e9bbd84219befd7c624cfd542249991d7d4d1c2 (patch)
treef8e9cbeb845f7a45941710978248d1adbc211412 /csharp/src
parentTest script env fixes (diff)
downloadice-2e9bbd84219befd7c624cfd542249991d7d4d1c2.tar.bz2
ice-2e9bbd84219befd7c624cfd542249991d7d4d1c2.tar.xz
ice-2e9bbd84219befd7c624cfd542249991d7d4d1c2.zip
Fixed ICE-6159: release memory allocated by connection buffers when the connection is closed instead of waiting for the reaping
Diffstat (limited to 'csharp/src')
-rw-r--r--csharp/src/Ice/ConnectionI.cs8
-rw-r--r--csharp/src/Ice/WSTransceiver.cs8
2 files changed, 15 insertions, 1 deletions
diff --git a/csharp/src/Ice/ConnectionI.cs b/csharp/src/Ice/ConnectionI.cs
index ba6729d48ba..56efa21ec1a 100644
--- a/csharp/src/Ice/ConnectionI.cs
+++ b/csharp/src/Ice/ConnectionI.cs
@@ -1444,6 +1444,14 @@ namespace Ice
}
_asyncRequests.Clear();
+ //
+ // Don't wait to be reaped to reclaim memory allocated by read/write streams.
+ //
+ _writeStream.clear();
+ _writeStream.getBuffer().clear();
+ _readStream.clear();
+ _readStream.getBuffer().clear();
+
if(_callback != null)
{
try
diff --git a/csharp/src/Ice/WSTransceiver.cs b/csharp/src/Ice/WSTransceiver.cs
index 09249d663da..b758e44dc7c 100644
--- a/csharp/src/Ice/WSTransceiver.cs
+++ b/csharp/src/Ice/WSTransceiver.cs
@@ -314,6 +314,12 @@ namespace IceInternal
{
_delegate.close();
_state = StateClosed;
+
+ //
+ // Clear the buffers now instead of waiting for destruction.
+ //
+ _readBuffer.clear();
+ _writeBuffer.clear();
}
public EndpointI bind()
@@ -1240,7 +1246,7 @@ namespace IceInternal
n = _readPayloadLength;
}
if(n > 0)
- {
+ {
System.Buffer.BlockCopy(_readBuffer.b.rawBytes(), _readBufferPos, buf.b.rawBytes(),
buf.b.position(), n);
buf.b.position(buf.b.position() + n);