Memory#

class jtop.core.memory.Memory#

Bases: GenericInterface

This class get the output from your memory, this class is readable like a dictionary, please read the documentation on memory but is also usable to enable, disable swap on your device

with jtop() as jetson:
    if jetson.ok():
        jetson.memory.swap_set(10, on_boot=False)

or if you want to deactivate a swap you can use this command

with jtop() as jetson:
    if jetson.ok():
        jetson.memory.swap_deactivate()

Below all methods available using the memory attribute

clear_cache()#

Clear the memory cache

swap_deactivate(path='')#

Deactivate a swap from a path or from default location /

Parameters:

path (str, optional) – Path swap

swap_is_enable(path)#

Check if a swap is on list

Parameters:

path (str) – Path swap

Returns:

Status swap

Return type:

bool

swap_path()#

Return the default SWAP path, Default path /

Returns:

Path swap

Return type:

str

swap_set(value, path='', on_boot=False)#

Create a new swap on a default path. swap_path()

Parameters:
  • value (int) – Size in G of a new SWAP

  • path (str, optional) – Path swap, defaults ‘’

  • on_boot (bool, optional) – Set this swap on boot, defaults False

Raises:

ValueError – value is not an int or a float