MCPcopy Create free account
hub / github.com/RUB-NDS/PRET / do_free

Method do_free

postscript.py:321–359  ·  view source on GitHub ↗

Show available memory.

(self, arg)

Source from the content-addressed store, hash-verified

319
320 # ------------------------[ free ]------------------------------------
321 def do_free(self, arg):
322 "Show available memory."
323 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
324 output().raw("RAM status")
325 output().info(self.cmd('currentsystemparams dup dup dup\n'
326 + '/mb 1048576 def /kb 100 def /str 32 string def\n'
327 + '(size: ) print /InstalledRam known {\n'
328 + ' /InstalledRam get dup mb div cvi str cvs print (.) print kb mod cvi str cvs print (M\\n) print}{pop (Not available\\n) print\n'
329 + '} ifelse\n'
330 + '(free: ) print /RamSize known {\n'
331 + ' /RamSize get dup mb div cvi str cvs print (.) print kb mod cvi str cvs print (M\\n) print}{pop (Not available\\n) print\n'
332 + '} ifelse'))
333 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
334 output().raw("Virtual memory")
335 output().info(self.cmd('vmstatus\n'
336 + '/mb 1048576 def /kb 100 def /str 32 string def\n'
337 + '(max: ) print dup mb div cvi str cvs print (.) print kb mod cvi str cvs print (M\\n) print\n'
338 + '(used: ) print dup mb div cvi str cvs print (.) print kb mod cvi str cvs print (M\\n) print\n'
339 + '(level: ) print =='))
340 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
341 output().raw("Font cache")
342 output().info(self.cmd('cachestatus\n'
343 + '/mb 1048576 def /kb 100 def /str 32 string def\n'
344 + '(blimit: ) print ==\n'
345 + '(cmax: ) print ==\n'
346 + '(csize: ) print ==\n'
347 + '(mmax: ) print ==\n'
348 + '(msize: ) print ==\n'
349 + '(bmax: ) print ==\n'
350 + '(bsize: ) print =='))
351 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
352 output().raw("User cache")
353 output().info(self.cmd('ucachestatus\n'
354 + '/mb 1048576 def /kb 100 def /str 32 string def\n'
355 + '(blimit: ) print ==\n'
356 + '(rmax: ) print ==\n'
357 + '(rsize: ) print ==\n'
358 + '(bmax: ) print ==\n'
359 + '(bsize: ) print =='))
360
361 # ------------------------[ devices ]---------------------------------
362 def do_devices(self, arg):

Callers

nothing calls this directly

Calls 4

cmdMethod · 0.95
outputClass · 0.90
rawMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected