The relationship between numCounters and maxCost

when use ristretto, what the relationship between numCounters and maxCost ? I want consume memory 10M, then set maxCost 10M, and cost return 100 bytes,but I found that it was way over the threshold .