Size of Qt containers: is QMap much larger than Qlist? -
i developing software maps information in 3d space. use container hold information. container use is
qlist< qlist< qmap<float, qlist<quint16> > > > lidardata;
which 2d grid representing rectangular area each cell 1 meter x 1 meter, , in each cell qmap contains key value representing height , list of 4 related values @ height. way can store 5 values (height + other values). insert values in loop (rown , coln row , column indexes respectively)
qlist<quint16> newlist; newlist << (width*100.0) << (1000.0+sens*100.0) << (quint16)(intensity*1000.0) ; lidardata[ rown ][ coln ].insert( heightvalue, newlist);
before approach instead of using qmap<float, qlist<quint16>
used qlist<quint16>
, appending 5 values.
question is: running program runs out of memory quite fast. took 800mb of memory complete first solution (qlist instead of qmap), runs out (at 1.4 gb) @ 75% of total data-storing process.
can confirm storing same amount of information using qmap<float, qlist<quint16>
instead of qlist<quint16>
require lot more space in memory?
have hints limit space? go old solution if nothing comes up.
as mentionned in comment:
your code may suffer primitive obsession.
try solve problem using valueobject fix stated in tutorial : create class needed attibutes, , work on instances of class instead of maintaining nested qlist
s , qmap
s.
Comments
Post a Comment