Project

Profile

Help

Bug #6392

open

Memory leak in PySaxonProcessor (Python)

Added by Andy Knight 15 days ago. Updated 12 days ago.

Status:
In Progress
Priority:
Normal
Category:
-
Start date:
2024-04-14
Due date:
% Done:

0%

Estimated time:
Found in version:
Fixed in version:
Platforms:

Description

Consider the following code fragment:

from saxonche import PySaxonProcessor import psutil

count = 0 prev = (mi := psutil.Process().memory_info)().rss

for _ in range(100): with PySaxonProcessor(license=False): pass if (count := count + 1) % 10 == 0: m = mi().rss print(f"{m - prev:,}") prev = m

It can be observed that memory usage increases over time. The exit functionality of the PySaxonProcessor class is not "cleaning up" as robustly as it should.

Python 3.12.2 saxonche 12.4.2 macOS 14.4.1 M2

Actions #1

Updated by Andy Knight 15 days ago

Apologies for incorrect code formatting in initial submission:

from saxonche import PySaxonProcessor
import psutil

count = 0
prev = (mi := psutil.Process().memory_info)().rss

for _ in range(100):
    with PySaxonProcessor(license=False):
        pass
    if (count := count + 1) % 10 == 0:
        m = mi().rss
        print(f"{m - prev:,}")
        prev = m
Actions #2

Updated by O'Neil Delpratt 14 days ago

  • Project changed from Saxon-CE to SaxonC

Moving this project to the SaxonC project

Actions #3

Updated by Matt Patterson 12 days ago

  • Status changed from New to In Progress
  • Assignee set to Matt Patterson

Please register to edit this issue

Also available in: Atom PDF