Open Transport 1.1: Memory Fragmentation

Side Navigation Graphic, See Text Links

Find It
Home
Table Of Contents
Support Pages
Feedback & Contact
Apple Computer, Inc.
Mirror Sites
Huh?

ListenUP plug-in URL

TECHINFO-0019484

TOPIC

It appears that memory does not get released properly after using some TCP/IP applications with Open Transport 1.1. Sometimes the Largest Unused Block in About This Macintosh decreases after quitting TCP/IP applications, but other times it does not appear to decrease.

I have selected Load only when needed in the TCP/IP control panel.

What could be causing this behavior?

DISCUSSION

There have been some reports of memory not being released when using TCP/IP applications with Open Transport. Although the issue is under investigation by Apple Engineering, it appears this could be a normal condition for the Mac OS based on the design of the Load only when needed option, especially if non-TCP applications are launched after a TCP/IP application.

When launching TCP/IP applications, if TCP is not loaded, Open Transport loads the TCP/IP stack into the application heap (memory reserved for applications under the Mac OS) after the TCP/IP application. After the last TCP/IP application is quit, the TCP/IP stack unloads from memory. However, if other non-TCP/IP applications have been loaded before quiting the TCP/IP application, memory can be fragmented.

For instance, if you load TCP/IP application A and another non-TCP/IP application B, memory will be arranged as follows (from top of memory to bottom):

Free Memory
APP B
TCP/IP STACK
APP A

Then, later you quit Application A, memory will look like:

Free Memory Block 2
APP B
Free Memory Block 1

At this point, the memory is fragmented because the free memory block is split into two parts by application B. If you looked at About this Macintosh, the Largest Unused Block would be smaller than it was before launching applications A and B. The Largest Unused Block is the largest block of contiguous memory, and with application B in the middle of two free memory blocks, blocks 1 and 2 cannot be joined together to form a larger contiguous block.

The workaround is to deselect the Load Only As Needed option in the TCP/IP control panel (but leave TCP/IP active). This will force the Mac OS to load TCP/IP into memory before applications use any of the application heap and prevent memory fragmentation. The drawback is that memory will always be allocated to the TCP/IP stack defeating the benefits of the Load only as needed option.

The TCP/IP stack will unload from memory about 2 minutes after there is NO TCP/IP activity. With some PPP connections, the stack will not unload. For PPP users, it is recommended they use the load always option.The Famous Apple!

Previous
[Previous] [Top] [Next]

-----------------------------------------------------------

"The Information Alley", in all formats, is copyright Apple Computer, Inc.
All Rights Reserved.