-
Couldn't load subscription status.
- Fork 174
Description
we use 0.6.0.0 and used like this:
public byte[] Serialize(T data)
{
using (MemoryStream stream = new MemoryStream())
{
// Creates serializer.
var serializer = SerializationContext.Default.GetSerializer();
// Pack obj to stream.
serializer.Pack(stream, data);
return stream.ToArray();
}
}
public T Deserialize<T>(byte[] data)
{
using (MemoryStream stream = new MemoryStream(data))
{
// Creates serializer.
var serializer = SerializationContext.Default.GetSerializer<T>();
// Pack obj to stream.
return serializer.Unpack(stream);
}
}
the Generics T now is:
[Serializable]
public class OrderLockingInfo
{
public OrderLockingInfo()
{
this.LockedBy = string.Empty;
}
public long OrderId { get; set; }
public bool IsLocked { get; set; }
public DateTime LockedDate { get; set; }
}
our Webapp host in IIS 7.5 base above codes crashed with memory Growing to top.
with the dump file, we saw almost are the belowe stack:
Child SP IP Call Site
000000001354c3e8 0000000077a2186a [GCFrame: 000000001354c3e8]
000000001354c5e0 0000000077a2186a [GCFrame: 000000001354c5e0]
000000001354c618 0000000077a2186a [HelperMethodFrame: 000000001354c618] System.Threading.Monitor.Enter(System.Object)
000000001354c710 000007fe9b0044a8 MsgPack.Serialization.SerializationContext.GetSerializer[System.__Canon, mscorlib]
000000001354ca20 000007fe9b005099 MsgPack.Serialization.SerializationContext.GetSerializer[System.__Canon, mscorlib]
000000001354ca70 000007fe9aff3fb8 GroupTour.LocalCache.MsgPackSerializer.Serialize[System.__Canon, mscorlib]
it seems the same Type Serializer object is lock the other thread is waiting.