ART: Improve Dbg::GetRecentAllocations

Move ClassTable to const char* instead of std::string, and let it
know when it needs to keep a copy of the string itself. This avoids
lots of temporary allocations.

Increase the stack depth in test 098 to better cover this behavior.
Add allocations of proxies and arrays to cover the backing storage.

Improvements on test 098:

Before:

heaptrack stats:
        allocations:            598174
        leaked allocations:     186
        temporary allocations:  132302

65797 calls to allocation functions with 3.34KB peak consumption from
art::StringTable::Add(char const*)
65666 calls to allocation functions with 144B peak consumption from
art::StringTable::IndexOf(char const*) const

After:

heaptrack stats:
        allocations:            466828
        leaked allocations:     186
        temporary allocations:  1002

Bug: 37620770
Test: m test-art-host
Test: art/test/testrunner/testrunner.py -b --host -t 098
Test: SANITIZE_HOST=address art/test/testrunner/testrunner.py -b --host -t 098
Change-Id: Iee496c96471dbb825c22b2656598c95f7c029a2f
2 files changed