QCustomPlot Discussion and Comments

largest supported data matrix in QCPCOlorMapReturn to overview

What is the largest supported data matrix in QCPColorMap?
N x M?

for example
error:
void QCPColorMapData::setSize(int, int) out of memory for data dimensions 128 * 220000

Hello,

By looking into the source code, we can see that the data from QCPColorMap is stored in a double pointer so, for simplicity, you can consider it as just an array of doubles that is allocated when we call setSize. Therefore it means that the largest supported data matrix is not fixed but depending on your computer.

What is weird is that 128 * 220 000 * 8 = 225,280,000. So you need a little bit more than 200 Mo to allocate the space needed for the map you want to plot. Except if you have a really really old pc you should have enough room for this kind of array. So you might have a memory leak somewhere or a process in your computer using a lot of your memory. Try using your task manager to supervise your memory usage and inspect where the problem comes from, if when you launch your qt program it goes up a lot try to find from which part of the code it comes. Maybe you have several copies of your data etc. I don't think we can help you a lot more except if i'm missing something but don't hesitate to ask if you struggle finding where it comes from.

Is this a 32 or 64-bit build? That will impact how much memory you can allocate. Did you drop a zero in your example? If the dimensions were 128 * 2,200,000, that's more than 2GB which would definitely be a problem for a 32-bit program.