<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">For reference, I was carrying coal to Newcastle <span style="caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; font-size: 16px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);">using fastapi. </span></div><div dir="ltr"><span style="caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; font-size: 16px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);"><br></span></div><div dir="ltr"><span style="caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; font-size: 16px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);">Removing fastapi and rewrite to start the mapscript part in a separate process solved the memory issues.</span></div><div dir="ltr"><span style="caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; font-size: 16px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);"><br></span></div><div dir="ltr"><span style="caret-color: rgb(32, 33, 34); color: rgb(32, 33, 34); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; font-size: 16px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2); background-color: rgb(255, 255, 255);">Trygve </span></div><div dir="ltr"><blockquote type="cite">4. okt. 2024 kl. 11:12 skrev Trygve Aspenes via MapServer-users <mapserver-users@lists.osgeo.org>:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>Hi all</span><br><span></span><br><span>I have a python mapscript using fastapi as the api.</span><br><span></span><br><span>The data I'm using is netcdf. So everything works fine.</span><br><span></span><br><span>However I see my app is eating more and more memory the more different datasets are requested.</span><br><span></span><br><span>Using lsof ( to see open files), I see the process don't cleanup the files used (they are open) as DATA in my mapscript setup.</span><br><span></span><br><span>In mapserver doc I see the mapscript funtion msCleanup()(mapscript section 5.1 MapScript Functions) I'm hoping could help me clean up this.</span><br><span></span><br><span>But when I add this I get error and crash of the process:</span><br><span>CPLGetTLSList(): pthread_setspecific() failed!</span><br><span></span><br><span>google gives me nothing.</span><br><span></span><br><span>The setup is mapserver from conda-forge 8.2.2 on python 3.11 with gdal 3.9.2</span><br><span></span><br><span>Any idea why this is happening, or how to keep better control over memory usage in an setup like this?</span><br><span></span><br><span>Trygve Aspenes</span><br><span>_______________________________________________</span><br><span>MapServer-users mailing list</span><br><span>MapServer-users@lists.osgeo.org</span><br><span>https://lists.osgeo.org/mailman/listinfo/mapserver-users</span><br></div></blockquote></body></html>