we aren't accounting for the size well for the last few large bins
It looks like we don't keep track of how many pages are actually allocated to the application in the last few "large" bins. For example we have a bin of size 1044480 (4096 pages), and one of size 520192 (127 pages). For a 128-page allocation, we don't keep track of the page count and end up thinking that there are 255 pages allocated.
We need some metadata about the actual allocated size for these internmediate sizes. Perhaps the bin numbers should go to page-count mode at 4 pages (and we should dealign the returned pointers, so if a user asks for 4 pages and it's not aligned, we allocate it in the 8-page bucket, and remember that there are 5 pages actually allocated.
As of 82cba8f4a4b1fd36b51ad06e726f6edb32d08ec8 we now have everything needed to calculate the space. Still need to actually calculate the space.