Re: Gradual Growth of Memory Use?
"Anthony REY (as anthony dot rey5 at gmail dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <CAKvKdhZ_Qbvs5WMAGi9=WwP1mwav2Z6TPOQqYX84COvPLcjAUA@mail.gmail.com> |
Not a Lisp expert at all : but I was wondering if accessing data in a cons cell chain is similar to accessing data in a LinkedList, which is O(N) ? Yuri's answers made me wonder if you might be running into heap fragmentation and then constantly cache miss when accessing the data pointed by your cells ? I don´t know enough about Garbage Collection or LispWorks to give more than an hazardous hypothesis, but I do work in the video games industry and we developed some strategies and data structures to make sure that the memory is staying contiguous in memory to please the cache as much as possible and ensure we can reach our real time performance goals : https://en.wikipedia.org/wiki/Entity_component_system Anthony Le jeu. 13 mars 2025 à 13:46, Yuri Davidovsky (as work at disclosure dot ie) <[email protected]> a écrit : > > > > On 13 Mar 2025, at 13:13, David McClain (as dbm at refined-audiometrics > dot com) <[email protected]> wrote: > > > > The telemetry data is simply being PUSH’d into a list. No permutations. > But that list becomes very long after 24 hours, and could cost a lot of > time chasing through all the links that never get discarded anyway. > > So it turns out that you do collect data, making the heap grow? So it is > not a memory leak per se, since you are actually hoarding it? I think the > solution here may be just to let it go, or flush it to the filesystem. > > And yes, if you have to traverse million entries long lists to find > something, it is not unfeasible that it may get slow as you would be > hopping all over the heap. Your idea to switch to arrays may help here, but > those had better be typed ones, as in, if you would have T element arrays, > it might not be too different to using lists. > > _______________________________________________ > Lisp Hug - the mailing list for LispWorks users > [email protected] > http://www.lispworks.com/support/lisp-hug.html >