fix memory calculation for cache insert decision, simplify drawing/rendering