structure MemStats is
integer Max_pool_size # max size the pool can grow to
integer Current_pool_size # the current size of the memory pool
integer Current_threshold # the internal threshold not currently used
integer Total_free_memory # total amount of free memory in pool
integer Free_memory_overhead # overhead for free memory blocks
integer Largest_free_block_size # size of the largest single free block (i.e. freesize)
integer Total_used_memory # total amount of memory in used blocks
integer Used_memory_overhead # overhead of used memory blocks
integer Unusable_memory # amount of memory that is unusable
integer Amount_squeezable # total amount of memory that can be percolated
# to the end of the pool by EslMemSqueeze.
integer Size_last_free_block_w_overhead
# If the last block in memory is free, then this
# gives the size of that block. If the last block is
# used, this is 0.
end structure
structure MemStats MemoryStatistics
function EslMemStats(small integer: MemId,
small integer: Hurry,
structure MemStats: Stats) returns integer
library "ESLLIB"
# MemId = memory pool id (1 for Easel Program or 2 for Global)
# Hurry if 1, some stats are set to -1 (i.e. not calculated) but EslMemStats will run faster
# if 0, all values are calculated, but EslMemStats will be slower.
response to start
set low memory threshold to 8192
response to low memory
copy EslMemStats(1, 0, MemoryStatistics) to Temp
send "Max_pool_size " MemoryStatistics.Max_pool_size "\n" to errorlog
send "Current_pool_size " MemoryStatistics.Current_pool_size "\n" to errorlog
send "Current_threshold " MemoryStatistics.Current_threshold "\n" to errorlog
send "Total_free_memory " MemoryStatistics.Total_free_memory "\n" to errorlog
send "Free_memory_overhead " MemoryStatistics.Free_memory_overhead "\n" to errorlog
send "Largest_free_block_size " MemoryStatistics.Largest_free_block_size "\n" to errorlog
send "Total_used_memory " MemoryStatistics.Total_used_memory "\n" to errorlog
send "Used_memory_overhead " MemoryStatistics.Used_memory_overhead "\n" to errorlog
send "Unusable_memory " MemoryStatistics.Unusable_memory "\n" to errorlog
send "Amount_squeezable " MemoryStatistics.Amount_squeezable "\n" to errorlog
send "Size_last_free_block_w_overhead "
MemoryStatistics.Size_last_free_block_w_overhead "\n" to errorlog
send "freesize before squeeze " freesize "\n" to errorlog
squeeze memory
send "freesize after squeeze " freesize "\n" to errorlog