Is there a way to rewrite the code so it does not update the FPS, ping, and memory all the time when hovering the TrackButton?

Yes, and I already told you how:

Originally Posted by Phanx

If you're seeing your tooltip addon occupy increasing amounts of memory, it's probably because you're generating a new table on every update, which is very expensive and wasteful. You should only create the "topAddOns" table once, outside of the "UpdateTooltip" method. Since the number of table entries (NUM_ADDONS_TO_DISPLAY) never changes you don't even need to clear the table between uses; you can just overwrite the values like you're already doing.

The code SDPhantom posted includes a number of other improvements/optimizations, so you should probably just use that, but you could solve the specific problem you asked about by making the one specific change I suggested (moving the "topAddOns" table creation outside of the "UpdateTooltip" method).