Sheerpower Logo
C.3  Discovering Overuse of Memory
When developing very large applications, with many programming languages it can be difficult to isolate memory overuse. Sheerpower provides tools to make this isolation easy using the option memlimit NN feature, where NN is the limit in megabytes. Once that limit is reached, Sheerpower will generate an exception and also output a memlimit text file.
option memlimit 4000 counter = 300_000_000 a$ = repeat$('x', counter)

MEMLIMIT Output File
The memlimit file is named XXX_memlimit.txt, where XXX is the name of the program. The text file contains the names of all variables and their content, the names of all tables and files, and the names and sizes of the active Sheerpower memory pools. Many of the pools are pre-allocated or over-allocated in order to speed-up processing.
--- Dump of memory pools --- ars MB: 2 code MB: 1 expressions MB: 145 data MB: 2 textfile MB: 17 strings MB: 3830 --- End of memory pools ---
Also, at the top of the file is the source line of the code that was executing on or directly after the memory limit was exceeded.
... details: MEMLIMIT of 4000 MB exceeded when assigning into BIG->DATA$ at MAIN.10

Summary: Discovering Overuse of Memory

Managing memory effectively is critical when developing large applications. SheerPower simplifies the process of isolating memory overuse with the option memlimit NN feature, where NN sets a memory limit in megabytes. If the limit is exceeded, SheerPower generates an exception and creates a memlimit text file for detailed analysis.

The generated memlimit file, named XXX_memlimit.txt (where XXX is the program name), provides a comprehensive memory usage report. It includes the names and contents of variables, tables, files, and active memory pools, along with their sizes. This detailed information helps developers quickly identify memory bottlenecks or inefficiencies.

Additionally, the file pinpoints the source code line that triggered the memory limit exception, enabling faster debugging and resolution. By using pre-allocated and over-allocated memory pools for efficiency, SheerPower ensures high performance while maintaining transparency in memory management.

The option memlimit feature turns memory optimization into a precise and manageable task, saving time and effort in diagnosing issues with large-scale applications.


Hide Description

    

       


      

Enter or modify the code below, and then click on RUN

Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use.
Wide screen