jvm-profiling-tools / honest-profiler

A sampling JVM profiler without the safepoint sample bias
https://github.com/RichardWarburton/honest-profiler/wiki
MIT License
1.25k stars 146 forks source link

Agent: Refactor concurrent map GC logic #226

Closed ikavalio closed 6 years ago

ikavalio commented 6 years ago

Hi,

This PR doesn't touch any core concurrent map functionality, it just simplifies/speeds up a couple of things:

  1. Adds a fix to the issue reported by @gauravAshok in #224
  2. Replaces all std::memory_order_consume with std::memory_order_acquire as the first was deprecated in c++17.
  3. Simplifies GC mechanics. Currently it's unnecessarily complicated as GC storage contains old HashTables that reference Migrations and Migrations are pointing back to the same HashTables. HashTable destructor had to traverse migrations chain and search for non-null pointers. New version is much simpler and Migrations are being deleted rather than tables. It allows to make certain things constant as a bonus.
RichardWarburton commented 6 years ago

Thanks @ikavalio - looks great.