Search linearly forwards instead of backwards for the stack usage, as stack allocations may not fill the allocated segments completely.