simplememorymanager.rb

Path: lib/mues/os-extensions/simplememorymanager.rb  (CVS)
Last Update: Sat Aug 18 22:54:10 -0700 2007

A simple memory-management strategy class for MUES::ObjectStore — a very simple manager that will swap disused objects out of memory at regular intervals. It does so by sending the MUES::ObjectSpaceVisitor it is given to all live objects at periodic intervals and swapping any that return true. This is not intended to be a very efficient collection strategy, but rather to provide basic functionality for testing and a starting point for more advanced algorithms. Iterations over large object spaces such as this are very resource-intensive, and an objectspace of more than a few hundred objects will almost certainly require a more sophisticated strategy.

This class is not intended to be loaded directly. It can be used by specifying ‘Simple’ as the fourth argument to MUES::ObjectStore#create, or by specifying ‘Simple’ in the class attribute of the memorymanager element of an objectstore section of the config file (see lib/mues/Config.rb for more).

Arguments

This collector accepts the following configuration arguments

Synopsis

  require 'mues/objectstore'

  os = MUES::ObjectStore::load( 'foo', [], nil, 'Simple' )
  ...

Version

 $Id: simplememorymanager.rb 1206 2004-05-09 21:25:11Z deveiant $

Authors

  • Martin Chase <stillflame@FaerieMUD.org>
  • Michael Granger <ged@FaerieMUD.org>

Copyright

Copyright (c) 2000-2003 The FaerieMUD Consortium. All rights reserved.

This module is free software. You may use, modify, and/or redistribute this software under the terms of the Perl Artistic License. (See language.perl.com/misc/Artistic.html)

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

[Validate]