Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPrinterAttributes causes memory usage increase #44

Open
believe2end opened this issue Nov 18, 2022 · 0 comments
Open

getPrinterAttributes causes memory usage increase #44

believe2end opened this issue Nov 18, 2022 · 0 comments

Comments

@believe2end
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant