Project

Profile

Help

Bug #6025 ยป Re_ [SaxonC - Bug #6025] (In Progress) Python Saxon not releasing memory - 2023-05-09T16_44_39Z.eml

Mark Pierce, 2023-05-09 18:44

 
X-He-Spam-Score: 3.9
Return-Path: <Mark.Pierce@cdl.co.uk>
Delivered-To: dropbox@plan.io
Received: from m.launch.gmbh ([127.0.0.1])
by m.launch.gmbh with LMTP id EJhsGGt4WmQQVAAAJzdhvw
for <dropbox@plan.io>; Tue, 09 May 2023 18:44:27 +0200
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on m.launch.gmbh
X-Spam-Level: ***
X-Spam-Status: No, score=3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,FORGED_SPF_HELO,HTML_MESSAGE,
RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_FAIL,SPF_HELO_PASS,
T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2
X-Spam-Report:
* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at
* https://www.dnswl.org/, no trust
* [40.107.10.44 listed in list.dnswl.org]
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
* [score: 0.0000]
* -0.1 DMARC_PASS DMARC check passed
* 5.0 SPF_FAIL SPF check failed
* -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2)
* [40.107.10.44 listed in wl.mailspike.net]
* -0.0 SPF_HELO_PASS SPF: HELO matches SPF record
* 0.0 HTML_MESSAGE BODY: HTML included in message
* 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
* valid
* -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
* author's domain
* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
* -0.0 T_SCC_BODY_TEXT_LINE No description available.
* 1.0 FORGED_SPF_HELO No description available.
X-Spam-Score: 3.9
Envelope-to: inbox+saxonica+f38e+saxon-c@plan.io
Authentication-Results: m.launch.gmbh; dmarc=pass (p=none dis=none) header.from=cdl.co.uk
Authentication-Results: m.launch.gmbh; spf=fail smtp.mailfrom=Mark.Pierce@cdl.co.uk
Authentication-Results: m.launch.gmbh;
dkim=pass (2048-bit key; unprotected) header.d=cdl.co.uk header.i=@cdl.co.uk header.b="WBPfRkt5";
dkim-atps=neutral
Received: from GBR01-LO2-obe.outbound.protection.outlook.com (mail-lo2gbr01on2044.outbound.protection.outlook.com [40.107.10.44])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by m.launch.gmbh (Postfix) with ESMTPS id 009028316B
for <inbox+saxonica+f38e+saxon-c@plan.io>; Tue, 9 May 2023 18:44:26 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=Eze/lTWfJF/YG+vMA3ERnp4t7g+yFiwXOXRtMuYh3kcJebmqq2sOGsluhMZngC8nBZHq+RK2OaMcyygKUS5ePeogZwdWeO63chEm/tRya56p1jSGLIjgwQwwgq3j0JvpGKuPtQiybRNachXiCeTvojpGtEZ1klHidfuMpvRVFP37ZjPoJjF9XxSSpG5+COBRkzRxnzEz4siK0LijF0mCzDiITx64uTkQJzFBnlTiKUetE+Ge8NAhMPDWoJ9/ZRGepTH+G3R1R7wQDNFVKc7UcjjOxe+oROMWybC/+MCcoIxj0IwBalfWT6ITPjHS6yibRSxVParok2K65hrwxGRJRQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=i3mJoQhbAhtxikAMvWoNOgwpdNTE43X2rzBdvfMUTlc=;
b=RyYuMz3IdKNwjhu18aZfwhwjsxqEGKs7Txma7WBeRGXE9HID6WDG4WIwXyVzPXfeqPBhatU+Z8+LsKnzfZklugwIyIQTB2Gqvjv/xJ/N+e1jKdYaGWyOqLkXXEtbs9BUCaKFQkdCHKTzvISBYDSilzPKeIVfDFlODhKZTv32LbBqGUSVPJDFisrRVdsFroJn8JwKoVVXQ3ThjAhHLsW8rTl2cvKQ44Xg9XU3rRSyvnsLTntxM/m2Ujhk5MMBZpeUrSYgwU5XYsDTgsZfoQp1fr1iUSy4Ox3S0BtzlUaCyCgl6VNT6lGck8Ag8UBhmDFGY9XFI2EWcgt4j/d5VDzsyQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cdl.co.uk; dmarc=pass action=none header.from=cdl.co.uk;
dkim=pass header.d=cdl.co.uk; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cdl.co.uk;
s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=i3mJoQhbAhtxikAMvWoNOgwpdNTE43X2rzBdvfMUTlc=;
b=WBPfRkt5I/4Uat5YUuvGhS4AsSjcE9DAbJwa0sfG4zWuk/WAC6GZfxA0LPiFxqq1hI0D1jdpImI+4f4IZINraaqTQw8Tg/Tom2ydLYRVn9+QxLiLXpB/W24wz7ns7nGqohgysAl1CiJ1nJjaxatPTLi/9BuCj5sujnkeyWetAckIjL9Iw/IY07c90VTcjYS9YUw01kwxtemi/StR7ecgGywShcx6il8bhqXl1ranJk7jlpDtddkh4eIEoyCeJtj5MuAnVrJJ37yjUEATmTJBWtuMuvj9ehX3r96qFuEoulDP8tmA5I+PA5PWnB1PI6cvCnTUiK32xtt/9y30rxGrsg==
Received: from CWLP123MB5136.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:12f::8)
by LO2P123MB7259.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:32b::10) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Tue, 9 May
2023 16:44:24 +0000
Received: from CWLP123MB5136.GBRP123.PROD.OUTLOOK.COM
([fe80::90af:a574:9b61:1ac9]) by CWLP123MB5136.GBRP123.PROD.OUTLOOK.COM
([fe80::90af:a574:9b61:1ac9%7]) with mapi id 15.20.6363.033; Tue, 9 May 2023
16:44:24 +0000
From: Mark Pierce <Mark.Pierce@cdl.co.uk>
To: Saxonica Developer Community <inbox+saxonica+f38e+saxon-c@plan.io>
Subject: Re: [SaxonC - Bug #6025] (In Progress) Python Saxon not releasing
memory
Thread-Topic: [SaxonC - Bug #6025] (In Progress) Python Saxon not releasing
memory
Thread-Index: AQHZgpRt+WZPOlYJQEOLvqdHU40w169SJZ1g
Date: Tue, 9 May 2023 16:44:24 +0000
Message-ID:
<CWLP123MB513686AAEA7F4E4E92DC49C0B0769@CWLP123MB5136.GBRP123.PROD.OUTLOOK.COM>
References: <redmine.issue-6025.20230509150033.4040@plan.io>
<redmine.journal-23774.20230509163632.4040@plan.io>
In-Reply-To: <redmine.journal-23774.20230509163632.4040@plan.io>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
MSIP_Label_d38e73b6-277a-44a2-a6e4-3be273e67173_Enabled=True;MSIP_Label_d38e73b6-277a-44a2-a6e4-3be273e67173_SiteId=b9421abd-55d8-45be-b89b-aa8974ddbc7f;MSIP_Label_d38e73b6-277a-44a2-a6e4-3be273e67173_SetDate=2023-05-09T16:44:22.9488083Z;MSIP_Label_d38e73b6-277a-44a2-a6e4-3be273e67173_ContentBits=0;MSIP_Label_d38e73b6-277a-44a2-a6e4-3be273e67173_Method=Privileged
authentication-results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=cdl.co.uk;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CWLP123MB5136:EE_|LO2P123MB7259:EE_
x-ms-office365-filtering-correlation-id: 0124e803-2807-4bcf-c7f8-08db50aca555
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
XFP1jPrhjxSysQ3awRsseV0wTXnRFygrgAdX/eZNYHiWSx356ydKmZYJjB5TEN06GmRc91lcZM+TuHAdOK962XCFa0PPeXg5jU3KXiK1NyDta8J72sagtxIA+FkrMmd/9h5fpvg9DSb0bMlvgtPYJE5BC0HHrI0v3IVkJX/KE3/MS3PfAIyznVbF/rG836iZIbKzbv1eXrj6Svz2lhwRS9bv+VU1AQhgUv7GT8OPwfxA3ogC9zljjAJAmD9rOcZEBkhvxZDqvNKNVb95vBF8yfSRtVLUBjmfqZlMwhNTNhyTlJlCq5al2GtD/IjzEKxT9jReNXDpi96ZyRO8/Wfu8asee22Zr0EqioFeiiZ8lcIVx+acGCRf39415UoZZMEx9JX51gtdG29SjrHzK18+nCuP8kBy+AeRsvs1OoNTotw8UGXLlrwA/tFl358KuNNaSHq6+L8IM/E6hSfbZ9u/SCZ+HuQezTeCZUL9yokg/z0Feqfo0UCEvzOaMgok7k8Q6ud7lRfr0YuOx3Y2GA0GaPICwX7FqvlGp2kxf6gTcWQE5i1k0ignbyZNCQ1qG14ATkzKJrfLTEZ9tcgqd/E3kxMnWS1ROFUnqLLDw8bd9J4=
x-forefront-antispam-report:
CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP123MB5136.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39850400004)(366004)(376002)(136003)(346002)(1690799014)(451199021)(91956017)(966005)(86362001)(38070700005)(316002)(71200400001)(66476007)(66556008)(7696005)(41300700001)(76116006)(66446008)(66946007)(64756008)(52536014)(5660300002)(8936002)(21615005)(166002)(40140700001)(8676002)(478600001)(9686003)(53546011)(55236004)(38100700002)(6506007)(26005)(2906002)(33656002)(186003)(122000001)(66574015)(83380400001)(55016003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
=?Windows-1252?Q?yx32fx2bBsDhWiqPyLwPOnuT2pmioWCmcmC+d3v9CZv3W2JhFMa1OBmr?=
=?Windows-1252?Q?Np3HoPv5nxaHCvzST5JEfKENRMeKZaXKbU3WlbWrHlpKX3kHi9498qCE?=
=?Windows-1252?Q?Ewzp5HFcGTj7RbpCWozUyo/lkRMOyQolI64SyxtAhnzcq5M1NS8InLmC?=
=?Windows-1252?Q?vSlIixqm+n1Dt6y3xhjdhriFSNbPvts96MjUVnBXWE3WDDBbcMGbTyyy?=
=?Windows-1252?Q?8y+YHyCPfOWTt6Qctpwls0mdAWlACgm4WDYny3on60OrLLkBaNVVOamR?=
=?Windows-1252?Q?jxLXAMI0+/+klrFBb0dpYEzzzg7lsw1wtU1lvejc1kadkrNc5i2MiQod?=
=?Windows-1252?Q?qYZkrt4XT7glfnW+tlS9TfckV8GMZ53OyyeRr0Dwatiz1o/j9G994NqG?=
=?Windows-1252?Q?k9ocbw9bpj7NUEydz1dfwFggIKPznV07S8w5r6qkXy7CKyj61mw0ALqf?=
=?Windows-1252?Q?a1vQQWLq747rzy039NmTjFXqZbAcz+A5R/d8TFJQuvQt+6Iga6VD4G2e?=
=?Windows-1252?Q?BaM0+m5cNErZE+f6j30EMXDUL4hOKeHAPiEj3Lr3yfTS20fCocMrt1ON?=
=?Windows-1252?Q?/QoN8VePa2vKudXvp71J6l2lGwVFIS3eRVzuhQvU6L5gvx6SU3Des9XD?=
=?Windows-1252?Q?MKYe+z+lIaQYQr1NcE495JHz/LTJaiVQHiisaiYlyolIK3jsqqWWagS/?=
=?Windows-1252?Q?ha0A2IAcLOq6ki21nbe00ij5jd2+A60NRGnhzxSr/ZkfzkDLgDMCfDxS?=
=?Windows-1252?Q?uG0OMk9QTxzBdPCQ6qJPUNC28C+y+73nASWLrN0uMT1fo0O/2SjGQWUY?=
=?Windows-1252?Q?U3AOKqHavCHFGsmgxuED4LbEpITPI6kCLPCZga9LcuvGp07CCoVQNSCF?=
=?Windows-1252?Q?yse6c7WlAUAxr85p/28MvXvX+67k+JqXlx7yDwwE41ptWVegnYhBk54Y?=
=?Windows-1252?Q?ivKzqxZ8oYHsWPxhbmFDF7Uud4immbh1bLfgDc6Pet9X/4Dv0FpfaDGa?=
=?Windows-1252?Q?RxfbG37OxkJaJcb2Y+uF/+09oa9L4KxX+aF2kgL774I6oPBRE71i5CZV?=
=?Windows-1252?Q?NG/cGGbHjzhgmZllUmT80uJGIp4SIwnPZKYE+qmOvCBVPNDxIpyjkaxy?=
=?Windows-1252?Q?4geAI0q+WJzTJdX/s3X6u7UQdKJDthiodOvCWuIYJIpxbAohhUeCQcfO?=
=?Windows-1252?Q?zGjDc+1Mjkc8Rs7D+eeqFLPmrqFYGfAl7nunb/phL4btxU4g7Y+unXQc?=
=?Windows-1252?Q?o+at1/U3ijZfeLQ6RTdQ5vPV8qsb2T/hWss5cH3y5rzluUr6I+CjtXNy?=
=?Windows-1252?Q?uyEyhXaHTHiI7jSvJvpCLpaa+jimvcCWnWtNoDAN0Kr+mGTd6oZxzTJ+?=
=?Windows-1252?Q?U22XxcIPFUkFHDyaiBX0Qp1GpSgv69zLpu3oqRIc4mdWwQXnqhFur3zx?=
=?Windows-1252?Q?F4bDZk+ko9tLeO3r4IkD+4dvUm+hnHanSV9R9FFKrEIth/KcFzKBMh8p?=
=?Windows-1252?Q?+fJFtKhYmkVxZCLIKZVOmUPBuMDTHnlJUWmFvm4y52je0BGNsRzUXOFk?=
=?Windows-1252?Q?0w60jcwucFDwkm8tuJW19QAIgP1Sl2emqzHXaPyGj3fE2qjWRqpGXblt?=
=?Windows-1252?Q?u3B0WF366gOPMbdAb2fpdwPiAw4MbhCFtd08NEFNTrSYYXPWBkgPkOM+?=
=?Windows-1252?Q?a6GWz+ZlfeJOwnqEwhcfvBIUm4HI1wYg/oKKZ4Q9vu9AmqbiSF+yCA?=
=?Windows-1252?Q?=3D=3D?=
Content-Type: multipart/alternative;
boundary="_000_CWLP123MB513686AAEA7F4E4E92DC49C0B0769CWLP123MB5136GBRP_"
MIME-Version: 1.0
X-OriginatorOrg: cdl.co.uk
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB5136.GBRP123.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 0124e803-2807-4bcf-c7f8-08db50aca555
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 May 2023 16:44:24.1069
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b9421abd-55d8-45be-b89b-aa8974ddbc7f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 455frLG7iQRNK7wzh0VnT+gQwSMhky1EkR5RypKayhJX+ct0Orxp+HGmA5cm0UmIN9z974CEfz9s32j7YCnSiA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO2P123MB7259

--_000_CWLP123MB513686AAEA7F4E4E92DC49C0B0769CWLP123MB5136GBRP_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Thank you, that=92s good to hear!

Hopefully, it=92s not too difficult to find the cause.

If you need anything else, please let me know.

From: Saxonica Developer Community <notifications@plan.io>
Date: Tuesday, 9 May 2023 at 17:36
To: Mark Pierce <Mark.Pierce@cdl.co.uk>
Subject: [SaxonC - Bug #6025] (In Progress) Python Saxon not releasing memo=
ry

--- In your reply, please do not write below this line ---
Issue #6025<https://saxonica.plan.io/issues/6025?pn=3D1#change-23774> has b=
een updated by O'Neil Delpratt.
________________________________

* Status changed from New to In Progress

Thanks for reporting this problem and sending us your repo. I managed to re=
produce the problem. Currently investigating it.

________________________________
Bug #6025: Python Saxon not releasing memory<https://saxonica.plan.io/issue=
s/6025?pn=3D1#change-23774> open

* Author: Mark Pierce
* Status: In Progress
* Priority: Normal
* Assignee: O'Neil Delpratt
* Category: Python
* Start date: 2023-05-09

I've recently built an AWS Lambda running Python 3.10 that takes a request,=
transforms it and returns the result.

This all seems fine and works quite well.

The issue is with each invocation the memory usage and runtime grows until =
it hits the limit and the lambda instance is killed off.

I've knocked up a very simple program that I can run locally which demonstr=
ates this behaviour.

import psutil

from saxoncpe import *



process =3D psutil.Process()

start_memory =3D process.memory_info().rss



with PySaxonProcessor(license=3DTrue) as saxon_processor:

xslt_proc =3D saxon_processor.new_xslt30_processor()

document =3D saxon_processor.parse_xml(xml_text=3D"<request></request>"=
)

executable =3D xslt_proc.compile_stylesheet(stylesheet_file=3D"transfor=
ms/QuoteRequest-sample.xslt")



values =3D range(1000)

for i in values:

executable.transform_to_string(xdm_node=3Ddocument)

print(process.memory_info().rss)



end_process =3D psutil.Process()

print("Start memory:")

print(start_memory)

print("End memory:")

print(process.memory_info().rss)

If you comment out all of the Saxon code then you will see the memory does =
not increase. If you move most of it out of the for loop, so it's only call=
ed once, and only have the transform_to_string function in the loop then th=
e memory still increases.

What is cause the memory to be locked? How can I release it so it can be us=
ed in an AWS lambda with 100s and 1000s of requests?

________________________________

You have received this notification because you have either subscribed to o=
r are involved in a project on Saxonica Developer Community site. To change=
your notification preferences, please click here: https://saxonica.plan.io=
/my/account?tour=3Dmail_preferences

This notification was cheerfully delivered by<https://plan.io/>
[Planio]<https://plan.io/>

[https://www.cdl.co.uk/assets/site-wide/social-newshub-icon.jpeg]<https://w=
ww.cdl.co.uk/media/newsletter.html>[https://www.cdl.co.uk/assets/site-wide/=
social-vacancy-icon.png]<https://www.cdl.co.uk/careers/vacancies.html>[http=
s://www.cdl.co.uk/assets/site-wide/social-twitter-icon.png]<http://twitter.=
com/CDL_Software>[https://www.cdl.co.uk/assets/site-wide/social-linkedin-ic=
on.png]<http://www.linkedin.com/company/cdl-cheshire-datasystems-ltd->[http=
s://www.cdl.co.uk/assets/site-wide/social-facebook-icon.png]<https://en-gb.=
facebook.com/CDLSoftware>
________________________________

Please consider the environment - Do you really need to print this email?

This email is intended only for the person(s) named above and may contain p=
rivate and confidential information. If it has come to you in error, please=
destroy and permanently delete any copy in your possession, and contact us=
on +44 (0)161 480 4420. The information in this email is copyright =A9 CDL=
Group Holdings Limited. We cannot accept liability for any loss or damage =
sustained as a result of software viruses. It is your responsibility to car=
ry out such virus checking as is necessary before opening any attachment.

Cheshire Datasystems Limited uses software which automatically screens inco=
ming emails for inappropriate content and attachments. If the software iden=
tifies such content or attachment, the email will be forwarded to our Techn=
ology department for checking. You should be aware that any email that you =
send to Cheshire Datasystems Limited is subject to this procedure.

________________________________
Cheshire Datasystems Limited, Strata House, Kings Reach Road, Stockport, SK=
4 2HD
Registered in England and Wales with company number 3991057
VAT registration: 727 1188 33


CDL - EXTERNAL

--_000_CWLP123MB513686AAEA7F4E4E92DC49C0B0769CWLP123MB5136GBRP_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
h1
{mso-style-priority:9;
mso-style-link:"Heading 1 Char";
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:24.0pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0088B7;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.Heading1Char
{mso-style-name:"Heading 1 Char";
mso-style-priority:9;
mso-style-link:"Heading 1";
font-family:"Calibri Light";
color:#2F5496;}
span.badge
{mso-style-name:badge;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.kn
{mso-style-name:kn;}
span.nn
{mso-style-name:nn;}
span.o
{mso-style-name:o;}
span.n
{mso-style-name:n;}
span.p
{mso-style-name:p;}
span.k
{mso-style-name:k;}
span.bp
{mso-style-name:bp;}
span.s
{mso-style-name:s;}
span.nb
{mso-style-name:nb;}
span.mi
{mso-style-name:mi;}
span.ow
{mso-style-name:ow;}
span.EmailStyle36
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1138768632;
mso-list-template-ids:192046230;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7 ;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:1848597964;
mso-list-template-ids:1389928852;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7 ;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7 ;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-GB" link=3D"#0088B7" vlink=3D"#0088B7" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;mso-fareast-language=
:EN-US">Thank you, that=92s good to hear!<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;mso-fareast-language=
:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;mso-fareast-language=
:EN-US">Hopefully, it=92s not too difficult to find the cause.<o:p></o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;mso-fareast-language=
:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;mso-fareast-language=
:EN-US">If you need anything else, please let me know.<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;mso-fareast-language=
:EN-US"><o:p>&nbsp;</o:p></span></p>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt;line-height:16.8pt"><b=
><span style=3D"font-size:12.0pt;color:black">From:
</span></b><span style=3D"font-size:12.0pt;color:black">Saxonica Developer =
Community &lt;notifications@plan.io&gt;<br>
<b>Date: </b>Tuesday, 9 May 2023 at 17:36<br>
<b>To: </b>Mark Pierce &lt;Mark.Pierce@cdl.co.uk&gt;<br>
<b>Subject: </b>[SaxonC - Bug #6025] (In Progress) Python Saxon not releasi=
ng memory<o:p></o:p></span></p>
</div>
<table class=3D"MsoNormalTable" border=3D"0" cellspacing=3D"0" cellpadding=
=3D"0" width=3D"100%" style=3D"width:100.0%;border-collapse:collapse;border=
-spacing:0">
<tbody>
<tr>
<td width=3D"100%" style=3D"width:100.0%;padding:0cm 0cm 0cm 0cm">
<p align=3D"center" style=3D"text-align:center"><span style=3D"font-size:9.=
0pt;font-family:Helvetica;color:#D7D7D7">--- In your reply, please do not w=
rite below this line ---<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style=3D"padding:0cm 0cm 0cm 0cm">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Issue <a href=3D"ht=
tps://saxonica.plan.io/issues/6025?pn=3D1#change-23774">
#6025</a> has been updated by O'Neil Delpratt. <o:p></o:p></span></p>
<div class=3D"MsoNormal" align=3D"center" style=3D"mso-margin-top-alt:14.4p=
t;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;text-align:center">
<span style=3D"font-size:11.0pt">
<hr size=3D"1" width=3D"100%" align=3D"center">
</span></div>
<span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;=
mso-fareast-language:EN-GB">
<ul type=3D"disc">
<li class=3D"MsoNormal" style=3D"color:#959595;mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
<strong><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,san=
s-serif">Status</span></strong><span style=3D"font-size:11.0pt"> changed fr=
om
<i>New</i> to <i>In Progress</i><o:p></o:p></span></li></ul>
</span>
<p>Thanks for reporting this problem and sending us your repo. I managed to=
reproduce the problem. Currently investigating it.<o:p></o:p></p>
<div class=3D"MsoNormal" align=3D"center" style=3D"mso-margin-top-alt:14.4p=
t;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;text-align:center">
<span style=3D"font-size:11.0pt">
<hr size=3D"1" width=3D"100%" align=3D"center">
</span></div>
<h1 style=3D"margin:0cm;line-height:16.8pt"><span style=3D"font-size:14.5pt=
;font-family:Helvetica;font-weight:normal"><a href=3D"https://saxonica.plan=
.io/issues/6025?pn=3D1#change-23774"><span style=3D"text-decoration:none">B=
ug #6025: Python Saxon not releasing memory</span></a>
</span><span class=3D"badge"><span style=3D"font-size:7.5pt;font-family:Hel=
vetica;color:#205D86;text-transform:uppercase;border:solid #205D86 1.0pt;pa=
dding:1.0pt">open</span></span><span style=3D"font-size:14.5pt;font-family:=
Helvetica;font-weight:normal">
<o:p></o:p></span></h1>
<ul type=3D"disc">
<li class=3D"MsoNormal" style=3D"color:#959595;mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<strong><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,san=
s-serif">Author: </span>
</strong><span style=3D"font-size:11.0pt">Mark Pierce<o:p></o:p></span></li=
><li class=3D"MsoNormal" style=3D"color:#959595;mso-margin-top-alt:auto;mso=
-margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<strong><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,san=
s-serif">Status: </span>
</strong><span style=3D"font-size:11.0pt">In Progress<o:p></o:p></span></li=
><li class=3D"MsoNormal" style=3D"color:#959595;mso-margin-top-alt:auto;mso=
-margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<strong><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,san=
s-serif">Priority:
</span></strong><span style=3D"font-size:11.0pt">Normal<o:p></o:p></span></=
li><li class=3D"MsoNormal" style=3D"color:#959595;mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<strong><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,san=
s-serif">Assignee:
</span></strong><span style=3D"font-size:11.0pt">O'Neil Delpratt<o:p></o:p>=
</span></li><li class=3D"MsoNormal" style=3D"color:#959595;mso-margin-top-a=
lt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<strong><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,san=
s-serif">Category:
</span></strong><span style=3D"font-size:11.0pt">Python<o:p></o:p></span></=
li><li class=3D"MsoNormal" style=3D"color:#959595;mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<strong><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&quot;,san=
s-serif">Start date:
</span></strong><span style=3D"font-size:11.0pt">2023-05-09<o:p></o:p></spa=
n></li></ul>
<p>I've recently built an AWS Lambda running Python 3.10 that takes a reque=
st, transforms it and returns the result.<o:p></o:p></p>
<p>This all seems fine and works quite well.<o:p></o:p></p>
<p>The issue is with each invocation the memory usage and runtime grows unt=
il it hits the limit and the lambda instance is killed off.<o:p></o:p></p>
<p>I've knocked up a very simple program that I can run locally which demon=
strates this behaviour.<o:p></o:p></p>
<pre style=3D"background:#ECECEC;border-radius:3px;overflow-x:auto;overflow=
-y:hidden"><span class=3D"kn"><span style=3D"font-size:8.0pt;font-family:Co=
nsolas;color:black;background:#ECECEC">import</span></span><code><span styl=
e=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> =
</span></code><span class=3D"nn"><span style=3D"font-size:8.0pt;font-family=
:Consolas;color:black;background:#ECECEC">psutil</span></span><code><span s=
tyle=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o:p></o:p=
></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"kn"><span style=3D"font-si=
ze:8.0pt;font-family:Consolas;color:black;background:#ECECEC">from</span></=
span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;=
background:#ECECEC"> </span></code><span class=3D"nn"><span style=3D"font-s=
ize:8.0pt;font-family:Consolas;color:black;background:#ECECEC">saxoncpe</sp=
an></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:b=
lack;background:#ECECEC"> </span></code><span class=3D"kn"><span style=3D"f=
ont-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">import<=
/span></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;colo=
r:black;background:#ECECEC"> </span></code><span class=3D"o"><span style=3D=
"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">*</sp=
an></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;backgro=
und:#ECECEC"><o:p></o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;background:#ECECEC"><o:p>&nbsp;</o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"n"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">process</span>=
</span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:blac=
k;background:#ECECEC"> </span></code><span class=3D"o"><span style=3D"font-=
size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">=3D</span><=
/span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:black=
;background:#ECECEC"> </span></code><span class=3D"n"><span style=3D"font-s=
ize:8.0pt;font-family:Consolas;color:black;background:#ECECEC">psutil</span=
></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consol=
as;color:black;background:#ECECEC">.</span></span><span class=3D"n"><span s=
tyle=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC=
">Process</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;fon=
t-family:Consolas;color:black;background:#ECECEC">()</span></span><code><sp=
an style=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o:p><=
/o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"n"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">start_memory</=
span></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color=
:black;background:#ECECEC"> </span></code><span class=3D"o"><span style=3D"=
font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">=3D</s=
pan></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:=
black;background:#ECECEC"> </span></code><span class=3D"n"><span style=3D"f=
ont-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">process=
</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:=
Consolas;color:black;background:#ECECEC">.</span></span><span class=3D"n"><=
span style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#=
ECECEC">memory_info</span></span><span class=3D"p"><span style=3D"font-size=
:8.0pt;font-family:Consolas;color:black;background:#ECECEC">().</span></spa=
n><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consolas;col=
or:black;background:#ECECEC">rss</span></span><code><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;background:#ECECEC"><o:p></o:p></span></code><=
/pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;background:#ECECEC"><o:p>&nbsp;</o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"k"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">with</span></s=
pan><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;b=
ackground:#ECECEC"> </span></code><span class=3D"n"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">PySaxonProcess=
or</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-famil=
y:Consolas;color:black;background:#ECECEC">(</span></span><span class=3D"n"=
><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;background=
:#ECECEC">license</span></span><span class=3D"o"><span style=3D"font-size:8=
.0pt;font-family:Consolas;color:black;background:#ECECEC">=3D</span></span>=
<span class=3D"bp"><span style=3D"font-size:8.0pt;font-family:Consolas;colo=
r:black;background:#ECECEC">True</span></span><span class=3D"p"><span style=
=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">)<=
/span></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;colo=
r:black;background:#ECECEC"> </span></code><span class=3D"k"><span style=3D=
"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">as</s=
pan></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:=
black;background:#ECECEC"> </span></code><span class=3D"n"><span style=3D"f=
ont-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">saxon_p=
rocessor</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">:</span></span><code><span=
style=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o:p></o=
:p></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">&nbsp;&nbsp;&nbsp; </span>=
</code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consola=
s;color:black;background:#ECECEC">xslt_proc</span></span><code><span style=
=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> <=
/span></code><span class=3D"o"><span style=3D"font-size:8.0pt;font-family:C=
onsolas;color:black;background:#ECECEC">=3D</span></span><code><span style=
=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> <=
/span></code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:C=
onsolas;color:black;background:#ECECEC">saxon_processor</span></span><span =
class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;color:black=
;background:#ECECEC">.</span></span><span class=3D"n"><span style=3D"font-s=
ize:8.0pt;font-family:Consolas;color:black;background:#ECECEC">new_xslt30_p=
rocessor</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">()</span></span><code><spa=
n style=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o:p></=
o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">&nbsp;&nbsp;&nbsp; </span>=
</code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consola=
s;color:black;background:#ECECEC">document</span></span><code><span style=
=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> <=
/span></code><span class=3D"o"><span style=3D"font-size:8.0pt;font-family:C=
onsolas;color:black;background:#ECECEC">=3D</span></span><code><span style=
=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> <=
/span></code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:C=
onsolas;color:black;background:#ECECEC">saxon_processor</span></span><span =
class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;color:black=
;background:#ECECEC">.</span></span><span class=3D"n"><span style=3D"font-s=
ize:8.0pt;font-family:Consolas;color:black;background:#ECECEC">parse_xml</s=
pan></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Con=
solas;color:black;background:#ECECEC">(</span></span><span class=3D"n"><spa=
n style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECE=
CEC">xml_text</span></span><span class=3D"o"><span style=3D"font-size:8.0pt=
;font-family:Consolas;color:black;background:#ECECEC">=3D</span></span><spa=
n class=3D"s"><span style=3D"font-size:8.0pt;font-family:Consolas;color:bla=
ck;background:#ECECEC">&quot;&lt;request&gt;&lt;/request&gt;&quot;</span></=
span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;=
color:black;background:#ECECEC">)</span></span><code><span style=3D"font-si=
ze:8.0pt;font-family:Consolas;background:#ECECEC"><o:p></o:p></span></code>=
</pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">&nbsp;&nbsp;&nbsp; </span>=
</code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consola=
s;color:black;background:#ECECEC">executable</span></span><code><span style=
=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> <=
/span></code><span class=3D"o"><span style=3D"font-size:8.0pt;font-family:C=
onsolas;color:black;background:#ECECEC">=3D</span></span><code><span style=
=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> <=
/span></code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:C=
onsolas;color:black;background:#ECECEC">xslt_proc</span></span><span class=
=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;back=
ground:#ECECEC">.</span></span><span class=3D"n"><span style=3D"font-size:8=
.0pt;font-family:Consolas;color:black;background:#ECECEC">compile_styleshee=
t</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family=
:Consolas;color:black;background:#ECECEC">(</span></span><span class=3D"n">=
<span style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:=
#ECECEC">stylesheet_file</span></span><span class=3D"o"><span style=3D"font=
-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">=3D</span>=
</span><span class=3D"s"><span style=3D"font-size:8.0pt;font-family:Consola=
s;color:black;background:#ECECEC">&quot;transforms/QuoteRequest-sample.xslt=
&quot;</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-f=
amily:Consolas;color:black;background:#ECECEC">)</span></span><code><span s=
tyle=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o:p></o:p=
></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;background:#ECECEC"><o:p>&nbsp;</o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">&nbsp;&nbsp;&nbsp; </span>=
</code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consola=
s;color:black;background:#ECECEC">values</span></span><code><span style=3D"=
font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> </spa=
n></code><span class=3D"o"><span style=3D"font-size:8.0pt;font-family:Conso=
las;color:black;background:#ECECEC">=3D</span></span><code><span style=3D"f=
ont-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> </span=
></code><span class=3D"nb"><span style=3D"font-size:8.0pt;font-family:Conso=
las;color:black;background:#ECECEC">range</span></span><span class=3D"p"><s=
pan style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#E=
CECEC">(</span></span><span class=3D"mi"><span style=3D"font-size:8.0pt;fon=
t-family:Consolas;color:black;background:#ECECEC">1000</span></span><span c=
lass=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;=
background:#ECECEC">)</span></span><code><span style=3D"font-size:8.0pt;fon=
t-family:Consolas;background:#ECECEC"><o:p></o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">&nbsp;&nbsp;&nbsp; </span>=
</code><span class=3D"k"><span style=3D"font-size:8.0pt;font-family:Consola=
s;color:black;background:#ECECEC">for</span></span><code><span style=3D"fon=
t-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> </span><=
/code><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consolas=
;color:black;background:#ECECEC">i</span></span><code><span style=3D"font-s=
ize:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> </span></co=
de><span class=3D"ow"><span style=3D"font-size:8.0pt;font-family:Consolas;c=
olor:black;background:#ECECEC">in</span></span><code><span style=3D"font-si=
ze:8.0pt;font-family:Consolas;color:black;background:#ECECEC"> </span></cod=
e><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consolas;col=
or:black;background:#ECECEC">values</span></span><span class=3D"p"><span st=
yle=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC"=
>:</span></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;b=
ackground:#ECECEC"><o:p></o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></code><span class=3D"n"><s=
pan style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#E=
CECEC">executable</span></span><span class=3D"p"><span style=3D"font-size:8=
.0pt;font-family:Consolas;color:black;background:#ECECEC">.</span></span><s=
pan class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consolas;color:b=
lack;background:#ECECEC">transform_to_string</span></span><span class=3D"p"=
><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;background=
:#ECECEC">(</span></span><span class=3D"n"><span style=3D"font-size:8.0pt;f=
ont-family:Consolas;color:black;background:#ECECEC">xdm_node</span></span><=
span class=3D"o"><span style=3D"font-size:8.0pt;font-family:Consolas;color:=
black;background:#ECECEC">=3D</span></span><span class=3D"n"><span style=3D=
"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">docum=
ent</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-fami=
ly:Consolas;color:black;background:#ECECEC">)</span></span><code><span styl=
e=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o:p></o:p></=
span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;color:black;background:#ECECEC">&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></code><span class=3D"k"><s=
pan style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#E=
CECEC">print</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;=
font-family:Consolas;color:black;background:#ECECEC">(</span></span><span c=
lass=3D"n"><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;=
background:#ECECEC">process</span></span><span class=3D"p"><span style=3D"f=
ont-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">.</span=
></span><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Consol=
as;color:black;background:#ECECEC">memory_info</span></span><span class=3D"=
p"><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;backgrou=
nd:#ECECEC">().</span></span><span class=3D"n"><span style=3D"font-size:8.0=
pt;font-family:Consolas;color:black;background:#ECECEC">rss</span></span><s=
pan class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;color:b=
lack;background:#ECECEC">)</span></span><code><span style=3D"font-size:8.0p=
t;font-family:Consolas;background:#ECECEC"><o:p></o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><code><span style=3D"font-size:8.0pt;font=
-family:Consolas;background:#ECECEC"><o:p>&nbsp;</o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"n"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">end_process</s=
pan></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:=
black;background:#ECECEC"> </span></code><span class=3D"o"><span style=3D"f=
ont-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">=3D</sp=
an></span><code><span style=3D"font-size:8.0pt;font-family:Consolas;color:b=
lack;background:#ECECEC"> </span></code><span class=3D"n"><span style=3D"fo=
nt-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">psutil</=
span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Co=
nsolas;color:black;background:#ECECEC">.</span></span><span class=3D"n"><sp=
an style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#EC=
ECEC">Process</span></span><span class=3D"p"><span style=3D"font-size:8.0pt=
;font-family:Consolas;color:black;background:#ECECEC">()</span></span><code=
><span style=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o=
:p></o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"k"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">print</span></=
span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;=
color:black;background:#ECECEC">(</span></span><span class=3D"s"><span styl=
e=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">&=
quot;Start memory:&quot;</span></span><span class=3D"p"><span style=3D"font=
-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">)</span></=
span><code><span style=3D"font-size:8.0pt;font-family:Consolas;background:#=
ECECEC"><o:p></o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"k"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">print</span></=
span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;=
color:black;background:#ECECEC">(</span></span><span class=3D"n"><span styl=
e=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">s=
tart_memory</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;f=
ont-family:Consolas;color:black;background:#ECECEC">)</span></span><code><s=
pan style=3D"font-size:8.0pt;font-family:Consolas;background:#ECECEC"><o:p>=
</o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"k"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">print</span></=
span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;=
color:black;background:#ECECEC">(</span></span><span class=3D"s"><span styl=
e=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">&=
quot;End memory:&quot;</span></span><span class=3D"p"><span style=3D"font-s=
ize:8.0pt;font-family:Consolas;color:black;background:#ECECEC">)</span></sp=
an><code><span style=3D"font-size:8.0pt;font-family:Consolas;background:#EC=
ECEC"><o:p></o:p></span></code></pre>
<pre style=3D"background:#ECECEC"><span class=3D"k"><span style=3D"font-siz=
e:8.0pt;font-family:Consolas;color:black;background:#ECECEC">print</span></=
span><span class=3D"p"><span style=3D"font-size:8.0pt;font-family:Consolas;=
color:black;background:#ECECEC">(</span></span><span class=3D"n"><span styl=
e=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">p=
rocess</span></span><span class=3D"p"><span style=3D"font-size:8.0pt;font-f=
amily:Consolas;color:black;background:#ECECEC">.</span></span><span class=
=3D"n"><span style=3D"font-size:8.0pt;font-family:Consolas;color:black;back=
ground:#ECECEC">memory_info</span></span><span class=3D"p"><span style=3D"f=
ont-size:8.0pt;font-family:Consolas;color:black;background:#ECECEC">().</sp=
an></span><span class=3D"n"><span style=3D"font-size:8.0pt;font-family:Cons=
olas;color:black;background:#ECECEC">rss</span></span><span class=3D"p"><sp=
an style=3D"font-size:8.0pt;font-family:Consolas;color:black;background:#EC=
ECEC">)</span></span><code><span style=3D"font-size:8.0pt;font-family:Conso=
las;background:#ECECEC"><o:p></o:p></span></code></pre>
<p>If you comment out all of the Saxon code then you will see the memory do=
es not increase. If you move most of it out of the for loop, so it's only c=
alled once, and only have the
<code><span style=3D"font-size:9.5pt;font-family:Consolas;color:black;backg=
round:#ECECEC">transform_to_string</span></code> function in the loop then =
the memory still increases.<o:p></o:p></p>
<p>What is cause the memory to be locked? How can I release it so it can be=
used in an AWS lambda with 100s and 1000s of requests?<o:p></o:p></p>
</td>
</tr>
<tr>
<td width=3D"100%" style=3D"width:100.0%;padding:0cm 0cm 0cm 0cm">
<div class=3D"MsoNormal" align=3D"center" style=3D"mso-margin-top-alt:14.4p=
t;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;text-align:center">
<span style=3D"font-size:9.0pt">
<hr size=3D"0" width=3D"100%" align=3D"center">
</span></div>
<p><span style=3D"font-size:9.0pt">You have received this notification beca=
use you have either subscribed to or are involved in a project on Saxonica =
Developer Community site. To change your notification preferences, please c=
lick here:
<a href=3D"https://saxonica.plan.io/my/account?tour=3Dmail_preferences">htt=
ps://saxonica.plan.io/my/account?tour=3Dmail_preferences</a><o:p></o:p></sp=
an></p>
</td>
</tr>
<tr>
<td width=3D"100%" style=3D"width:100.0%;padding:0cm 0cm 0cm 0cm">
<p class=3D"MsoNormal" align=3D"center" style=3D"text-align:center"><span s=
tyle=3D"font-size:13.0pt;font-family:Helvetica;color:#D7D7D7"><o:p>&nbsp;</=
o:p></span></p>
<div>
<p class=3D"MsoNormal" align=3D"center" style=3D"text-align:center"><span s=
tyle=3D"font-size:13.0pt;font-family:Helvetica;color:#D7D7D7"><a href=3D"ht=
tps://plan.io/"><span style=3D"color:#D7D7D7;text-decoration:none">This not=
ification was cheerfully delivered by</span></a><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td width=3D"100%" style=3D"width:100.0%;padding:0cm 0cm 0cm 0cm">
<p class=3D"MsoNormal" align=3D"center" style=3D"text-align:center"><a href=
=3D"https://plan.io/" title=3D"&quot;Planio&quot; "><span style=3D"font-siz=
e:11.0pt;color:windowtext;text-decoration:none"><span style=3D"color:#0088B=
7"><img border=3D"0" width=3D"102" height=3D"25" style=3D"width:1.0625in;he=
ight:.2604in" id=3D"_x0000_i1025" src=3D"https://assets.plan.io/images/plan=
io_logo_gray_204x50.png" alt=3D"Planio"></span></span></a><span style=3D"fo=
nt-size:11.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p>&nbsp;</o:p></=
span></p>
</div>
<div><a href=3D"https://www.cdl.co.uk/media/newsletter.html"><img src=3D"ht=
tps://www.cdl.co.uk/assets/site-wide/social-newshub-icon.jpeg" hspace=3D"2"=
height=3D"50" margin-right=3D"3" width=3D"275" border=3D"0"></a><a href=3D=
"https://www.cdl.co.uk/careers/vacancies.html"><img src=3D"https://www.cdl.=
co.uk/assets/site-wide/social-vacancy-icon.png" hspace=3D"2" height=3D"50" =
margin-right=3D"3" width=3D"50" border=3D"0"></a><a href=3D"http://twitter.=
com/CDL_Software"><img src=3D"https://www.cdl.co.uk/assets/site-wide/social=
-twitter-icon.png" hspace=3D"2" height=3D"50" width=3D"50" margin-right=3D"=
3" border=3D"0"></a><a href=3D"http://www.linkedin.com/company/cdl-cheshire=
-datasystems-ltd-"><img src=3D"https://www.cdl.co.uk/assets/site-wide/socia=
l-linkedin-icon.png" hspace=3D"2" height=3D"50" width=3D"50" margin-right=
=3D"3" border=3D"0"></a><a href=3D"https://en-gb.facebook.com/CDLSoftware">=
<img src=3D"https://www.cdl.co.uk/assets/site-wide/social-facebook-icon.png=
" hspace=3D"2" height=3D"50" width=3D"50" border=3D"0"></a>
</div>
<div class=3D"MsoNormal" align=3D"center" style=3D"text-align:center"><span=
style=3D"font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;mso-fare=
ast-language:EN-GB">
<hr size=3D"2" width=3D"100%" align=3D"center">
</span></div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:8.5pt;font-family:&quot;Ari=
al&quot;,sans-serif;mso-fareast-language:EN-GB"><br>
Please consider the environment - Do you really need to print this email? <=
/span>
</p>
<p><span style=3D"font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif"=
>This email is intended only for the person(s) named above and may contain =
private and confidential information. If it has come to you in error, pleas=
e destroy and permanently delete any copy in
your possession, and contact us on +44 (0)161 480 4420. The information in=
this email is copyright =A9 CDL Group Holdings Limited. We cannot accept l=
iability for any loss or damage sustained as a result of software viruses. =
It is your responsibility to carry
out such virus checking as is necessary before opening any attachment.</sp=
an></p>
<p><span style=3D"font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif"=
>Cheshire Datasystems Limited uses software which automatically screens inc=
oming emails for inappropriate content and attachments. If the software ide=
ntifies such content or attachment, the email
will be forwarded to our Technology department for checking. You should be=
aware that any email that you send to Cheshire Datasystems Limited is subj=
ect to this procedure.
</span></p>
<div class=3D"MsoNormal" align=3D"center" style=3D"text-align:center"><span=
style=3D"font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;mso-fare=
ast-language:EN-GB">
<hr size=3D"2" width=3D"100%" align=3D"center">
</span></div>
<p class=3D"MsoNormal"><strong><span style=3D"font-size:8.5pt;font-family:&=
quot;Arial&quot;,sans-serif;mso-fareast-language:EN-GB">Cheshire Datasystem=
s Limited, Strata House, Kings Reach Road, Stockport, SK4 2HD</span></stron=
g><span style=3D"font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;m=
so-fareast-language:EN-GB"><br>
Registered in England and Wales with company number 3991057<br>
VAT registration: 727 1188 33</span></p>
</div>
<br>
<p style=3D"font-family:Calibri;font-size:10pt;color:#000000;margin:5pt;" a=
lign=3D"Center">
CDL - EXTERNAL<br>
</p>
</body>
</html>

--_000_CWLP123MB513686AAEA7F4E4E92DC49C0B0769CWLP123MB5136GBRP_--
    (1-1/1)