reduce memory requirements for this test

...it caused out of memory frequently.
This commit is contained in:
Fischlurch 2012-01-07 03:27:31 +01:00
parent 90e6dae2d5
commit feff7537ef
3 changed files with 13 additions and 5 deletions

View file

@ -124,6 +124,10 @@ namespace lib {
* on the thread-local diagnostic stack. Might * on the thread-local diagnostic stack. Might
* be empty. Values start with frame next to * be empty. Values start with frame next to
* the current scope and end with outermost. * the current scope and end with outermost.
* @warning can be inefficient on very large stacks
* @todo benchmark and improve the data structure
* used for the snapshot. Vector is not
* an optimal choice here.
*/ */
static ValSequence static ValSequence
extractStack() extractStack()

View file

@ -679,7 +679,7 @@ return: 0
END END
TEST "Thread-local diagnostic context" DiagrnsticContext_test <<END TEST "Thread-local diagnostic context" DiagnosticContext_test <<END
return: 0 return: 0
END END

View file

@ -1,5 +1,5 @@
/* /*
DiagrnsticContext(Test) - verify thread local stack for collecting diagnostics DiagnosticContext(Test) - verify thread local stack for collecting diagnostics
Copyright (C) Lumiera.org Copyright (C) Lumiera.org
2011, Hermann Vosseler <Ichthyostega@web.de> 2011, Hermann Vosseler <Ichthyostega@web.de>
@ -39,8 +39,9 @@ namespace test{
namespace { // private test setup... namespace { // private test setup...
/* WARNING: memory hungry */
const uint NUM_THREADS = 40; const uint NUM_THREADS = 40;
const uint MAX_RAND = 1000*1000; const uint MAX_RAND = 100*1000;
inline bool inline bool
isOdd (uint val) isOdd (uint val)
@ -80,7 +81,7 @@ namespace test{
* @see lib::ThreadLocal * @see lib::ThreadLocal
* @see backend::Thread * @see backend::Thread
*/ */
class DiagrnsticContext_test : public Test class DiagnosticContext_test : public Test
{ {
virtual void virtual void
@ -147,6 +148,9 @@ namespace test{
* take a snapshot of the full ContextStack and then unwind. * take a snapshot of the full ContextStack and then unwind.
* Thus the captured numbers must from a decreasing sequence * Thus the captured numbers must from a decreasing sequence
* of odd values. * of odd values.
* @warning this test case causes memory pressure.
* The reason seems to be the frequent re-allocations
* of the vector used to take the snapshots
*/ */
void void
verify_heavilyParallelUsage() verify_heavilyParallelUsage()
@ -206,7 +210,7 @@ namespace test{
/** Register this test class... */ /** Register this test class... */
LAUNCHER (DiagrnsticContext_test, "function common"); LAUNCHER (DiagnosticContext_test, "function common");