Using BufferPool

I am reading the documentation on BufferPool, and I would like to use it.

in it there is a function setBufferPoolConfig with the second and third argument being stack Size and stack count.

Later a GpuMat is allocated as
GpuMat d_src1 = pool1.getBuffer(4096, 4096, CV_8UC1);

I am not really sure how to select these values. When allocating the GpuMat , is it allocating 16MB for one image??my images are only 282KB so that is far too much, isn’t it?

I would like for someone to explain to me how to select the values in those two functions