Maintenance: Planio will be observing a scheduled maintenance window this Tuesday, November 5, 2024 from 03:00 UTC until 06:30 UTC to perform urgent network maintenance in our primary data center. Your Planio account will be unavailable during this maintenance window.
Actions
Bug #6397
closedBug #6392: Memory leak in PySaxonProcessor (Python)
Another? memory leak when using XPath
Start date:
2024-04-16
Due date:
% Done:
0%
Estimated time:
Applies to branch:
Fix Committed on Branch:
12
Fixed in Maintenance Release:
Found in version:
12.4.2
Fixed in version:
12.5
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:
Description
Here is a pure XPath evaluation also showing a memory leak:
from saxonche import PySaxonProcessor
import psutil
xpath = "random-number-generator(current-dateTime())?permute(1 to 20)"
count = 0
process = psutil.Process()
prev = process.memory_info().rss
print(f"{prev:,}")
print()
with PySaxonProcessor() as proc:
xpath_processor = proc.new_xpath_processor()
for _ in range(100):
xpath_processor.evaluate(xpath)
if (count := count + 1) % 10 == 0:
m = process.memory_info().rss
print(f"{m - prev:,}")
prev = m
print()
print(f"{prev:,}")
Windows shows
26,116,096
3,866,624
507,904
491,520
499,712
495,616
499,712
495,616
499,712
495,616
499,712
34,467,840
Linux shows
32,849,920
7,581,696
270,336
540,672
540,672
540,672
540,672
540,672
540,672
270,336
540,672
44,756,992
Updated by Naim Malek 6 months ago
Martin Honnen wrote:
Here is a pure XPath evaluation also showing a memory leak:
from saxonche import PySaxonProcessor import psutil xpath = "random-number-generator(current-dateTime())?permute(1 to 20)" count = 0 process = psutil.Process() prev = process.memory_info().rss print(f"{prev:,}") print() with PySaxonProcessor() as proc: xpath_processor = proc.new_xpath_processor() for _ in range(100): xpath_processor.evaluate(xpath) if (count := count + 1) % 10 == 0: m = process.memory_info().rss print(f"{m - prev:,}") prev = m print() print(f"{prev:,}")
Windows shows
26,116,096 3,866,624 507,904 491,520 499,712 495,616 499,712 495,616 499,712 495,616 499,712 34,467,840
Linux shows
32,849,920 7,581,696 270,336 540,672 540,672 540,672 540,672 540,672 540,672 270,336 540,672 44,756,992
It's the same issue I am getting.
Updated by O'Neil Delpratt 4 months ago
- Status changed from Resolved to Closed
- Fixed in version changed from 12.5.0 to 12.5
Bug fix applied in the Saxon 12.5 Maintenance release.
Please register to edit this issue
Actions