02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

6.12.2 Stack Overflow<br />

When a task exceeds its stack size, the resulting problem is often hard to trace,<br />

because the initial symptom may be in some other task altogether. The browser’s<br />

stack-check window is useful when faced with behavior that is hard to explain: if<br />

the problem is a stack overflow, you can spot it immediately. The affected task’s<br />

stack display shows a high-water mark at the right edge, as in the example in<br />

Figure 6-22.<br />

Figure 6-22<br />

Stack Overflow on Task u9<br />

6.12.3 Memory Fragmentation<br />

A more subtle memory-management problem occurs when small blocks of<br />

memory that are not freed for long periods are allocated interleaved with<br />

moderate-sized blocks of memory that are freed more frequently: memory can<br />

become fragmented, because the calls to free( )for the large blocks cannot coalesce<br />

the free memory back into a single large available-memory pool. This problem is<br />

easily observed by examining the affected memory partition (in simple<br />

applications this is the VxWorks system memory partition, memSysPartId) with<br />

the browser. Figure 6-23 shows an example of a growing free-list with many small<br />

blocks, characteristic of memory fragmentation.<br />

228

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!