Hello,
during my stress-test performance test I’ve noticed that If I use in servicerunned the compression I got on the client side a suspected memory leak on System.Net.DeflateWrapperStream
Here’s the code I use to compress data (I think it’s almost vanilla)
public class IFServiceRunner<TRequest> : ServiceRunner<TRequest>
{
static IFServiceRunner()
{
}
public IFServiceRunner(IAppHost appHost, ActionContext actionContext)
: base(appHost, actionContext)
{
}
public override object OnAfterExecute(ServiceStack.Web.IRequest requestContext, object response)
{
if ((response != null) && !(response is CompressedResult) && !(response is HttpResult))
response = requestContext.ToOptimizedResult(response);
return base.OnAfterExecute(requestContext, response);
}
public override object HandleException(ServiceStack.Web.IRequest request, TRequest requestDto, Exception ex)
{
ILog log = LogManager.GetLogger(GetType());
string error = string.Format("[url:{1}] - [data:{0}]", requestDto.SerializeToString(), request.PathInfo);
log.Error(error, ex);
return base.HandleException(request, requestDto, ex);
}
}
If I comment those compression lines in the OnAfterExecute method those memory leaks fades away
The code I use to call the service is
var res = await client.GetAsync<User>(urlForAuthentication);
Any suggestion?
Thanks