Please tell us what you were doing! You can include code and files by drag and dropping them into the text area.
Hi! I managed to narrow down a memory leak I experienced with a patch of mine. Hopefully you can also repro with the attached patch:
<pre><code>
----------begin_max5_patcher----------
2441.3oc6cs0bahCE989qfwSeL0itKw9T+ezYmL3XRVxZCd.7tY2cZ+suHIH
wtFvHiq3lbmIwwHvG9NWz4bj3q+2m7JdsZSxagYq9Muuo9S4q+682UMfhCe9
GpNv9f2dZWPl7jWEG92Iadc0CWNp7v2xkiHINbSP7Kdv5Fzgf7m9in3WdLM7
I4n+lGU.WSeviBEqAO3wnxehPqAd+dMmd7w8IGy2ElKkETMCPez7+4Pn5huR
JIqdn720dIi1pD5Mu9ELXU8ekQwUeimc3u+9e88G5EltOLKK3kv1.0m1EFj1
M.kI.R.kCPRnDa.fB6.fdMPDwGuf3gzn37NZUBNCDQVFDECDHdcu6m2cLZ65
sA4AYg4+va++7XbRTV3iayd74zj8aN97ygczPkHvJLF6qPW3c10W51eUf1+Z
.MbvrV+.N+.kuA3kQUvKjZ6.ArQqM7FOb2gvBPiTLEkxBk0cHDa5jScbRJDY
frXuNr9ZT958AG79p7G.On2WfllDfOPYqh322PAER1i6CxSidqSAEviVHV6+
+ieNffDowHuulEr+PlGDHe0MfmS7UAIPpruPL78E3edWRPdmMsQiZS6FvdiL
vKwYHEbeijbtAtgl6vAB12bLOOI1rHwDsAJo5m2m4x5j0YCdToA6CyCSeLLN
XyN40CLlMhUVtxXEJOyheaRvhpnzTkR.R7GxnzPw3M0sfsaOjTTqg2mgeDtP
8I0Fh6PZXVXbdPdTR7i6hhCeJ4XbdCnVMwvAZ2Ar5WPlkSziLZyyyvNQ3qCt
HPCciHni2Rn+BXMAAvBpGXsu.xfL4avEu78jGhSHE48AVyP9Tg7inbD.RjeD
DB3Ht7cHBkhfpCBXD4khSETpn3MEAU3BdwaPTD.PUitXP.4kBPIPAScLAvWc
LFAiTh.12mgjuAfPL00l.4Tl5SDbsXxA.NVI.DfODK+VnTBBokNRwExWKmBe
kHfK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xkgw5gHKBWFXzaIzhZFZYqHDFNCjk
BPX3z091xh2vz5sT1MFNqHwRwsjDjmQy9Xon79lAWbaBWFHWBgEkK33yYjSG
mAI3jwobQLz9hYI6dgvL6KNzhxkAguDWAuNqwgMPTZ0QLZ0QDZMP7YWgnytj
XyJAqFHtrO88+G3m9l0O
-----------end_max5_patcher-----------
</code></pre>
In the patch, I used a subpatcher in place of fluid.list2buf because that object was my earlier suspect for the memory leak.
What was the expected result?
Executing any of the 3 snippets any number of times should not result in a consistent raise in the Max app's memory usage (as reported by the Activity Monitor app). The buffers are actually only modified once, the datasets are filled with the same vector for N samples (in the first two cases), but only after they are cleared.
What was the actual result?
When evaluating the top two snippets (using setpoint and addpoint) repeatedly, a consistent raise in the Max app's memory usage (as reported by the Activity Monitor app) can be observed. (It went up to 85GB in a "patch in the wild", and up to 9GB while testing specifically with the attached patch.) The third snippet (bottom) that relies on frombuffer does not exhibit the memory leak. So the issue seems to be related to addpoint and setpoint.
What operating system were you using?
Mac
Operating system version
macOS 26.5.1
FluCoMa Version
1.0.9
Please tell us what you were doing! You can include code and files by drag and dropping them into the text area.
Hi! I managed to narrow down a memory leak I experienced with a patch of mine. Hopefully you can also repro with the attached patch:
In the patch, I used a subpatcher in place of
fluid.list2bufbecause that object was my earlier suspect for the memory leak.What was the expected result?
Executing any of the 3 snippets any number of times should not result in a consistent raise in the Max app's memory usage (as reported by the Activity Monitor app). The buffers are actually only modified once, the datasets are filled with the same vector for N samples (in the first two cases), but only after they are cleared.
What was the actual result?
When evaluating the top two snippets (using
setpointandaddpoint) repeatedly, a consistent raise in the Max app's memory usage (as reported by the Activity Monitor app) can be observed. (It went up to 85GB in a "patch in the wild", and up to 9GB while testing specifically with the attached patch.) The third snippet (bottom) that relies onfrombufferdoes not exhibit the memory leak. So the issue seems to be related toaddpointandsetpoint.What operating system were you using?
Mac
Operating system version
macOS 26.5.1
FluCoMa Version
1.0.9