If the fillWithSize method bails out because bean.getUsage().getUsed() > CACHE_USAGE_COEF * maxSize, it does not add the just allocated blob to the list:
http://hg.openjdk.java.net/jdk10/hs/file/d4bfafe600d0/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java#l78
Also, we start with allocating blobs of size 368 Mb which is too large for a default code cache size of 256 Mb.
size = coef * minAllocationUnit = coef * (MIN_ALLOCATION - headerSize) = coef * (CodeCacheSegmentSize * CodeCacheMinBlockLength - headerSize) = 1_000_000 * (128 * 4 - 144) = 368 Mb
http://hg.openjdk.java.net/jdk10/hs/file/d4bfafe600d0/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java#l78
Also, we start with allocating blobs of size 368 Mb which is too large for a default code cache size of 256 Mb.
size = coef * minAllocationUnit = coef * (MIN_ALLOCATION - headerSize) = coef * (CodeCacheSegmentSize * CodeCacheMinBlockLength - headerSize) = 1_000_000 * (128 * 4 - 144) = 368 Mb