Skip to content

getPrinterAttributes causes memory usage increase #44

@believe2end

Description

@believe2end

Recently I use this ARM board as a print box : Orange Pi Zero2
The OS is Debian
When I test this code:

import cups as cp                                                                                                                                                                                               
import time
import tracemalloc

tracemalloc.start()
cn = cp.Connection()
while True:
    time.sleep(1)
    snapshot1 = tracemalloc.take_snapshot()
    cn.getPrinterAttributes("Canon_G5080_series")
    time.sleep(1)


    snapshot2 = tracemalloc.take_snapshot()
    top_stats = snapshot2.compare_to(snapshot1, 'lineno')
    print("[ Top 10 differences ]")
    for stat in top_stats[:10]:
            print(stat)

    top_stats = snapshot2.statistics('traceback')

    # pick the biggest memory block
    stat = top_stats[0]
    print("%s memory blocks: %.1f KiB" % (stat.count, stat.size / 1024))
    for line in stat.traceback.format():
            print(line)

I found the memory usage keeps increase:
image

This is the log file memory_increase.log

This is my system&&cpus info:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions