+
Point of view
All features
class MEMORY_EXAMPLE1
Summary
Here is a little cookbook for people using very small computers. We suppose here that the goal is to save memory.
Note: to see how many times the garbage collector is triggered, keep in mind that you can use the -gc_info flag as in:
   compile -gc_info -boost example1
Also note that you can run this example under the debugger:
   compile -gc_info -sedb -no_check example1
Direct parents
Insert list: MEMORY
Overview
Creation features
{ANY}
Features
{ANY}
Garbage collector information and tuning:
{ANY}
Liberty Eiffel Garbage collector information and tuning:
{ANY}
main
effective procedure
{ANY}
collecting: BOOLEAN
frozen
{ANY}
Is garbage collection enabled?
collection_off
frozen
{ANY}
Disable garbage collection.
Call this always in pairs with collection_on´.
collection_on
frozen
{ANY}
Enable garbage collection.
Call this always in pairs with collection_off´.
full_collect
frozen
{ANY}
Force a full collection cycle if garbage collection enabled (i.e. collecting is True); do nothing otherwise.
collector_counter: INTEGER_32
frozen
{ANY}
The number of collections actually performed or -1 when the system is not using any garbage collector (i.e. when the system is compiled using the -no_gc flag).
ensure
  • Result >= -1
smart_eiffel_collector: BOOLEAN
frozen
effective function
{ANY}
Is the Liberty Eiffel garbage collector really used?
ensure
low_memory_strategy: BOOLEAN
frozen
effective function
{ANY}
Is the low memory strategy in use?
When this strategy is used, the garbage collector tries to use as few memory as possible.
require
set_low_memory_strategy
frozen
effective procedure
{ANY}
high_memory_strategy: BOOLEAN
frozen
effective function
{ANY}
Is the high memory strategy in use?
When this strategy is used, the garbage collector assumes that more memory can be allocated if necessary.
require
set_high_memory_strategy
frozen
effective procedure
{ANY}
default_memory_strategy: BOOLEAN
frozen
effective function
{ANY}
Is the default memory strategy in use?
This is the default initial mode for the garbage collector (somewhere between low_memory_strategy and high_memory_strategy).
require
set_default_memory_strategy
frozen
effective procedure
{ANY}
allocated_bytes: INTEGER_32
frozen
{ANY}
Total number of allocated bytes of memory in the heap.
allow_gc_before_exit
frozen
effective procedure
{ANY}
Allow the SmartEiffel GC to run before the process exists.
That is the default state when the Liberty Eiffel GC is used and contracts are checked.
require
forbid_gc_before_exit
frozen
effective procedure
{ANY}
Forbid the Liberty Eiffel GC to run at the end of the process run.
That is the default state when the Liberty Eiffel GC is used but the contracts are not checked.
require