RAM Usage Reporting

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

RAM Usage Reporting

Post by Don_Kirby »

The compiler output tells me that my application uses 472 bytes of RAM, but the listing file reports an extra 3112 bytes, for a total of 3584 bytes. I'm assuming that the discrepancy is due to system calls and other internal workings of the virtual machine.

I'm curious though, if the compiler output could reflect this true number, i.e. give me a breakdown of the actual RAM usage rather than just the amount used by the variables in my application.

-Don
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

I get this type of output:

Code: Select all

Code: 35 bytes, RAM: 1 byte, Persistent memory: 0 bytes
Target Device: ZX24a, Minimum VM version: v1.1.2
RAM size: 3584, heap size: 256
Did you misread the listing file? Perhaps you can post an example (sans code) so we can see what you mean.
Mike Perks
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: RAM Usage Reporting

Post by dkinzer »

Don_Kirby wrote:The compiler output tells me that my application uses 472 bytes of RAM, but the listing file reports an extra 3112 bytes, for a total of 3584 bytes.
Are you perhaps referring to the last line of the .lst file that looks something like this:

Code: Select all

RAM size: 3584, heap size: 256
That is indicating the amount of User RAM that is available, not how much is being used.
Don_Kirby wrote:[Can the compiler] give me a breakdown of the actual RAM usage rather than just the amount used by the variables in my application.
You'll find more information on RAM use in the .map file. For each task, it gives an estimate of the stack space needed. For each routine, it itemized the local variables (that contribute to stack use).
- Don Kinzer
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Re: RAM Usage Reporting

Post by Don_Kirby »

dkinzer wrote: That is indicating the amount of User RAM that is available, not how much is being used.
That makes much more sense.

-Don
Post Reply