Ravenbrook / Projects / Memory Pool System / Master Product Sources / Design Documents

Memory Pool System Project


GC Messages

David Jones, Ravenbrook Limited, 2003-02-17

1. Introduction

This document describes the design of a set of MPS message classes. The messages from these classes are emitted according to various important phases in a GC cycle; collectively they are called GC Messages.

The current classes are:

mps_message_type_gc_start()

(new in gcgenmsg branch) These messages are generated once per GC at the start of a GC.

mps_message_type_gc()

These messages are generated once per GC at the end of a GC.

The intended readership is project staff.

This document is not confidential.

2. Background, MPS messages and collections

This needs filling in. Taken as read and understood for now.

Note that some of the implementation (of mps_message_type_gc) pre-dates this design; it may not be documented accurately (or at all) here.

3. Requirements

The primary requirement is:

We meet part of that requirement by implementing a message that is generated per collection (mps_message_type_gc_start).

We have the following requirements on per GC messages:

4. Implementation

4.2 A new per collection message class (mps_message_type_gc_start)

Messages in this class support:

4.2.1 Message instances.

As well as TraceMessageStruct (for mps_message_type_gc) there will be a TraceStartMessageStruct. Could this be rolled into TraceMessageStruct? Not really (maybe with a redesign) as TraceMessageStruct is dynamically allocated as the message is posted to the arena queue (at the end of the trace).

5. Interface

int mps_message_type_gc_start()

Public interface. Returns the MPS message type.

const char *mps_message_gc_start_why(mps_arena_t, mps_message_t)

Public interface. Returns a pointer to a string that is a textual explanation of why this collection is starting.

The contents of the string must not be modified by the client. The string and the pointer are only valid as long as the message has not been discarded (with mps_message_discard).

6. Testing

amcss already collects and reports mps_message_type_gc. It should be simple to extend it to mps_message_type_gc_start and mps_message_type_gc_generation.

Using amcss might not give a very good coverage. In particular not all the available reasons will appear. Perhaps a more dedicated test should be written.

7. Unimplemented mps_message_type_gc_generation

This section for historical interest only.

A proposal to more fully meet the primary requirement by implementing a message that is generated per generation per collection (mps_message_type_gc_generation) has not been implemented, but the requirements have been retained here:

We would have the following requirements on per generation messages:

A. References

B. Document History

2003-02-17 DRJ Created.
2006-12-07 RHSK Remove mps_message_type_gc_generation (not implemented).
2007-02-08 RHSK Move historically interesting requirements for mps_message_type_gc_generation (not implemented) to the end of the doc.

C. Copyright and License

This document is copyright © 1995-2002, 2006-2007 Ravenbrook Limited. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Redistributions in any form must be accompanied by information on how to obtain complete source code for the this software and any accompanying software that uses this software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and must be freely redistributable under reasonable conditions. For an executable file, complete source code means the source code for all modules it contains. It does not include source code for modules or files that typically accompany the major components of the operating system on which the executable file runs.

This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement, are disclaimed. In no event shall the copyright holders and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.


$Id: //info.ravenbrook.com/project/mps/branch/2003-02-17/gcgenmsg/design/message/index.html#1 $

Ravenbrook / Projects / Memory Pool System / Master Product Sources / Design Documents