I do not have much experience with QT, and this problem appeared today.
QList<int> memList; const int large = 100000; getchar(); for (int i=0; i<large; i++) { memList.append(i); } cout << memList.size() << endl; getchar(); for (int i=0; i<large; i++) { memList.removeLast(); } cout << memList.size() << endl; getchar();
After the first cycle, when I check the memory usage, it rises as new elements are added to memList , but after removing them during the second cycle, the memory usage remains at the same level. I thought the QList was dynamic and it frees up memory when the item is deleted. So either I'm missing something (very likely) or it's not a dynamic structure. Do you have any idea how to make it work?
Hi
source share