Home>

With the restart of the browser there are no problems, but I do not know how to track RAM. I found the Memory_Profiler library and one of its functions allows you to find out how much memory is occupied by the script, but I still do not understand how to find out how much memory on the device. Maybe to solve my problem there are some more convenient ways?

And what device, what kind of operating system?

CrazyElf2021-05-04 10:17:36
  • Answer # 1

    psutil Virtual_Memory.and

    Import Psutil, OS
    o= psutil.virtual_memory ()
    Print (O) # OS
    # SVMEM (Total= 17170841600, Available= 9212215296, percent= 46.3, USED= 7958626304, FREE= 9212215296)
    s= psutil.process (os.getpid ()). Memory_info ()
    Print (s) # SCR
    # Pmem (rss= 49,266,688, vms= 273,924,096, num_page_faults= 16341, peak_wset= 49,717,248, wset= 49,266,688, peak_paged_pool= 361912, paged_pool= 361,816, peak_nonpaged_pool= 35384, nonpaged_pool= 35304, pagefile= 273,924,096, peak_pagefile= 275,312,640, private= 273924096 )
    
  • Answer # 2

    psutil Virtual_Memory.and

    Import Psutil, OS
    o= psutil.virtual_memory ()
    Print (O) # OS
    # SVMEM (Total= 17170841600, Available= 9212215296, percent= 46.3, USED= 7958626304, FREE= 9212215296)
    s= psutil.process (os.getpid ()). Memory_info ()
    Print (s) # SCR
    # Pmem (rss= 49,266,688, vms= 273,924,096, num_page_faults= 16341, peak_wset= 49,717,248, wset= 49,266,688, peak_paged_pool= 361912, paged_pool= 361,816, peak_nonpaged_pool= 35384, nonpaged_pool= 35304, pagefile= 273,924,096, peak_pagefile= 275,312,640, private= 273924096 )