removing most atomic operations from cache balancing
fixing __sync_* link error on 32-bit
fixing code review comments and adding upper limit on cache size