This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| java.lang.OutOfMemoryError: Java heap space |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (frame.Method.Type.Name == "System.Threading.Tasks.Task") | |
| { | |
| if (frame.Method.Name == "Execute") | |
| { | |
| // the previous frame should contain the name of the method called by the task | |
| if (lastFrame != null) | |
| { | |
| // this is a task executing the method | |
| // given by lastFrame.DisplayString | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach (var thread in _host.Session.Clr.Threads | |
| .Where(t => t.IsThreadpoolWorker) | |
| .OrderBy(t => (t.LockCount > 0) ? -1 : (!t.IsAlive ? t.ManagedThreadId + 10000 : t.ManagedThreadId))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private ThreadPoolItem GetQueueUserWorkItemCallback(dynamic element) | |
| { | |
| ThreadPoolItem tpi = new ThreadPoolItem() | |
| { | |
| Address = (ulong)element, | |
| Type = ThreadRoot.WorkItem | |
| }; | |
| // look for the callback given to ThreadPool.QueueUserWorkItem() | |
| var callback = element.callback; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // anonymous method | |
| if (method.Type.Name == targetType.Name) | |
| { | |
| return $"{targetType.Name}.{method.Name}"; | |
| } | |
| else | |
| // method is implemented by an class inherited from targetType | |
| // ... or a simple delegate indirection to a static/instance method | |
| { | |
| if ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (method == null) | |
| { | |
| // could happen in case of static method | |
| methodPtr = action._methodPtrAux; | |
| method = _clr.GetMethodByAddress((ulong)methodPtr); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| internal string BuildDelegateMethodName(ClrType targetType, dynamic action) | |
| { | |
| var methodPtr = action._methodPtr; | |
| if (methodPtr != null) | |
| { | |
| ClrMethod method = _clr.GetMethodByAddress((ulong)methodPtr); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private ThreadPoolItem GetTask(dynamic task) | |
| { | |
| ThreadPoolItem tpi = new ThreadPoolItem() | |
| { | |
| Address = (ulong)task, | |
| Type = ThreadRoot.Task | |
| }; | |
| // look for the context in m_action._target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private ThreadPoolItem GetThreadPoolItem(dynamic item) | |
| { | |
| // get the ClrType directly from the dynamic proxy | |
| ClrType itemType = item.GetClrType(); | |
| if (itemType.Name == "System.Threading.Tasks.Task") | |
| { | |
| return GetTask(item); | |
| } | |
| else if (itemType.Name == "System.Threading.QueueUserWorkItemCallback") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private IEnumerable<ThreadPoolItem> EnumerateThreadPoolStealingQueue(dynamic stealingQueue) | |
| { | |
| var array = stealingQueue.m_array; | |
| if (array == null) | |
| yield break; | |
| foreach (var item in array) | |
| { | |
| if (item == null) | |
| continue; |