Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Slowdown around 5.0.5-dev-0



On Oct 12,  6:50pm, Sebastian Gniazdowski wrote:
} Subject: Re: Slowdown around 5.0.5-dev-0
}
} On 12 October 2015 at 16:01, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > If you configure --enable-zsh-heap-debug you can edit mem.c to set a
} > value for the heap_debug_verbosity variable
} 
} Did that, set heap_debug_verbosity to 0x7f. When I issue a search,
} screen gets constantly outputted with messages about heap pop.

Yes, you probably want to prefix your test with

	{
	  exec {fd}>&2 2>&debug_trace_file.txt
	  # your test here
	} always {
	  exec 2>&$fd
	}

(choose your own file name).  I mean to mention that but forgot.

If you capture the output in a file (it may be a BIG file) you can do
things like "fgrep -c allocated" to count the number of times each heap
event happens.

} Maybe the numbers mean something?

Yes, they're an ID assigned every time a heap is either pushed or freed;
e.g.:

} HEAP DEBUG: heap 98f8 freed, new id is fb71a8.

The heap ID is incremented once at each push or free, so there have been
a minimum of 16439472 heap operations (fb71a8 - 98f8) between the
creation of that heap and the eventual free.  (Note the number of heap
operations is the number of push+free multiplied by the average number
of heap arenas, because a new ID is assigned to each arena every time.)

There should be a message about "pushed" corresponding to each "popped",
like this pair:

} HEAP DEBUG: heap fb71a8 pushed, new id is fb71a9.
} HEAP DEBUG: heap fb71a9 popped, old heap was fb71a8.

You should also have sometimes seen "allocated memory from ..." or
"create new heap ..." messages.  The fact that your scrollback is
almost entirely "popped" messages is an indication that you're really
deep in a recursion at the time your script exits.

-- 
Barton E. Schaefer



Messages sorted by: Reverse Date, Date, Thread, Author