GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | FRE

Edit History

FRE

FRE (x)

Home > Reference > System

Returns system memory information. eg, 0 = free memory. If a value is not supported by the operating system, fre will return 0. fre() without a parameter returns the free physical memory.

Windows

x Description
0 free memory
-1 largest block of integers
-2 free stack
-3 largest free block
-12 free memory same as 0

LINUX and ANDROID

x Description
0 free memory
-10 total physical memory
-11 used physical memory
-12 free physical memory same as 0

Alternative for LINUX with kernel > 3.x and ANDROID

fre can be used to read the values of the file /proc/meminfo. In a console please type cat /proc/meminfo. Output should look similar to this (but more lines):

MemTotal:        3630512 kB
MemFree:          117204 kB
MemAvailable:     601308 kB
Buffers:           52680 kB
Cached:          1002608 kB
SwapCached:        58640 kB
Active:           857224 kB
Inactive:        1781244 kB

To querry with fre the value of the first line, use fre(0), for second line fre(1), and so on.

Example

print "Free memory: "; fre()
print "Total RAM: "; fre(-10)
print "Used RAM: "; fre(-11)
print "Free RAM: "; fre(-12)
Code samples using FRE
7gables.bas   agendus.bas   ai.bas   base64.bas   bonkers.bas   checkers.bas   chess.bas   circles Kalide v2.bas   clock.bas   coordplot.bas   dmsareaplot.bas   dmsareareadmd.bas   dogstar5.bas   driven_mass_and_spring.bas   filemanager.bas   form demo.bas   frehand.bas   g2 Life.bas   g3 Life.bas   g4 Life.bas   g5 Life.bas   g6 Life.bas   galgenmann.bas   gridareaplot.bas   GUI RPSLS v2.bas   hangman v2.bas   hangman.bas   irc-bot.bas   loadsavebmp.bas  
System
CHAIN   COMMAND   CWD   DELAY   ENV   ENV   EXEC   EXPORT   FRE   HOME   IMPORT   INCLUDE   MAXINT   NIL   OPTION   PAUSE   PI   PROGLINE   RANDOMIZE   RUN   SBVER   SELF   STKDUMP   TROFF   TRON   UNIT  
This page was last edited on Sun, 12 Mar 2023 14:43:52 +0100 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.