Optimize GC while prehandling.
This commit is contained in:
@@ -250,6 +250,13 @@ namespace Cryville.Crtr {
|
|||||||
UnityEngine.Profiling.Profiler.GetTotalReservedMemory()
|
UnityEngine.Profiling.Profiler.GetTotalReservedMemory()
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
if (ContainerState.RMVPool != null) {
|
||||||
|
statusbuf.AppendFormat(
|
||||||
|
"\nPools: RMV {0}, MC {1}",
|
||||||
|
ContainerState.RMVPool.RentedCount,
|
||||||
|
ContainerState.MCPool.RentedCount
|
||||||
|
);
|
||||||
|
}
|
||||||
if (loadThread != null) {
|
if (loadThread != null) {
|
||||||
statusbuf.AppendFormat(
|
statusbuf.AppendFormat(
|
||||||
"\n(Loading textures) Progress: {0:P}\n(Loading files) Progress: {1:P}",
|
"\n(Loading textures) Progress: {0:P}\n(Loading files) Progress: {1:P}",
|
||||||
@@ -259,10 +266,8 @@ namespace Cryville.Crtr {
|
|||||||
if (prehandler != null) statusbuf.AppendFormat("\n(Prehandling) Progress: {0:P}", prehandler.Progress);
|
if (prehandler != null) statusbuf.AppendFormat("\n(Prehandling) Progress: {0:P}", prehandler.Progress);
|
||||||
if (started) {
|
if (started) {
|
||||||
statusbuf.AppendFormat(
|
statusbuf.AppendFormat(
|
||||||
"\nStates: c{0} / b{1}\nPools: RMV {2}, MC {3}",
|
"\nStates: c{0} / b{1}",
|
||||||
cbus.ActiveStateCount, bbus.ActiveStateCount,
|
cbus.ActiveStateCount, bbus.ActiveStateCount
|
||||||
ContainerState.RMVPool.RentedCount,
|
|
||||||
ContainerState.MCPool.RentedCount
|
|
||||||
);
|
);
|
||||||
statusbuf.AppendFormat(
|
statusbuf.AppendFormat(
|
||||||
"\nSTime: {0:G17}s {3} {4}\ndATime: {1:+0.0ms;-0.0ms;0} {3} {4}\ndITime: {2:+0.0ms;-0.0ms;0} {3} {5}",
|
"\nSTime: {0:G17}s {3} {4}\ndATime: {1:+0.0ms;-0.0ms;0} {3} {4}\ndITime: {2:+0.0ms;-0.0ms;0} {3} {5}",
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ namespace Cryville.Crtr.Event {
|
|||||||
private set {
|
private set {
|
||||||
if (m_active == value) return;
|
if (m_active == value) return;
|
||||||
m_active = value;
|
m_active = value;
|
||||||
if (!m_active && CloneType == 1) Dispose();
|
if (!m_active) {
|
||||||
|
if (CloneType == 1) Dispose();
|
||||||
|
else if (CloneType >= 16) ReleasePools();
|
||||||
|
}
|
||||||
if (Parent != null) {
|
if (Parent != null) {
|
||||||
if (m_active) Parent.ActiveChildren.Add(Container);
|
if (m_active) Parent.ActiveChildren.Add(Container);
|
||||||
else Parent.ActiveChildren.Remove(Container);
|
else Parent.ActiveChildren.Remove(Container);
|
||||||
@@ -191,10 +194,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
if (Disposed) return;
|
if (Disposed) return;
|
||||||
Disposed = true;
|
Disposed = true;
|
||||||
if (CloneType == 1) Handler.Dispose();
|
if (CloneType == 1) Handler.Dispose();
|
||||||
if (CloneType == 1 || CloneType == 17) {
|
ReleasePools();
|
||||||
_rmvpa.ReturnAll();
|
|
||||||
_mcpa.ReturnAll();
|
|
||||||
}
|
|
||||||
foreach (var s in Children)
|
foreach (var s in Children)
|
||||||
s.Value.Dispose();
|
s.Value.Dispose();
|
||||||
}
|
}
|
||||||
@@ -203,6 +203,10 @@ namespace Cryville.Crtr.Event {
|
|||||||
s.Value.DisposeAll();
|
s.Value.DisposeAll();
|
||||||
Handler.DisposeAll();
|
Handler.DisposeAll();
|
||||||
}
|
}
|
||||||
|
public void ReleasePools() {
|
||||||
|
_rmvpa.ReturnAll();
|
||||||
|
_mcpa.ReturnAll();
|
||||||
|
}
|
||||||
|
|
||||||
public void AttachHandler(ContainerHandler h) {
|
public void AttachHandler(ContainerHandler h) {
|
||||||
if (Handler != null)
|
if (Handler != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user