heapSpace

returns the number of free bytes in the application heap on Mac OS.

# Metadata

Platforms: desktop, server OS: mac Introduced: 1.0 Security:

# Syntax

the heapSpace

# Examples

the heapSpace

if the heapSpace < 1024^2 then suggestLowMemory

# Description

Use the heapSpace function to determine how much free memory remains.

This function exists to aid compatibility with imported HyperCard stacks. It may not return the exact amount of free memory. It also does not take available temporary memory into account.

On Unix and Windows systems, this function does not return a meaningful value.

# Tags

# See

- **property:** size, alwaysBuffer, destroyStack - **function:** hasMemory, stackSpace - **glossary:** byte, Mac OS, return - **control structure:** function