I would like to drop my trick for Deep Profile in addition to OP's answer. I also got thrown out of memory when using Deep profile.
What is problem?
The problem become clear if developer were to Deep Profile on logic-heavy part, that's happen in single frame, let's say, also in my case, map generation. Which has several O^2 or worse stuff that would result in calling over something in magnitude of 100,000 times. Deep Profile will try to document EVERY function calls (!) which can bring editor or your entire PC to its knee.
The screenshot below demonstrate what happen when I record only 1 frame that happen to contain very logic heavy stuffs.

Solution
The only workaround is to divide your logic-heavy part into coroutine, and have it run over several frames, so that profiler does not cough up in one go. Between it you could "Clear" profiler anytime and that will also release memory.
Convert your function into coroutine. Divide and conquer until you can isolate heaviest part that you want to profile or cause profiler to crash.
My trick here is to use Debug.LogError
which will print error to console. If Console has Error Pause option on, editor will auto-pause, with the help of yield return null
which jump out of coroutine and wait for next frame, effectively it will pause just before that code part will run. So you can easily press Step in editor to advance frame manually.
IEnumerator MapGeneration( )
{
Debug.LogError( "Before part 1" );
yield return null;
/* Code part 1 here */
Debug.LogError( "Before part 2" );
yield return null;
/* Code part 2 here */
... // And more, you get the idea
// If there is subfunction that need to break down
// You could also convert it to Coroutine too and call it this way
yield return SubFunction( );
}