unsigned int n=90000000;tbb::concurrent_queue
q;for(unsigned int i=0; i q.push(i);}cout << "queue full" << endl;sleep(10); // program size at this pt: roughly 1.2Gcout << "start popping" << endl;for(unsigned int i=0; i double v;q.pop(v);}cout << "done popping" << endl;sleep(3600); // program still using 1.2GIs this correct? And is there a suggested workaround that people use?
It's probably a different issue (high-water mark behaviour of scalable memory allocator), discussed elsewhere. In this case the program is triggering the problem by not throttling the input, which may also adversely affect performance by being all over the place in RAM, or worse.
I have not yet disected or otherwise scrutinised concurrent_queue (but just have a look at micro_queue_pop_finalizer), so I purposefully used the word "probably", but this is also easily tested...