I'm using aleph and manifold for communicating with the StarCraft II AI API. Yesterday I tried my hand at a run-loop and I completed one of the challenges using Clojure (yay!). I'm using alephs websocket to connect to the api which uses protobuf to communicate. And I utilize streams for the run-loop, but after around 100 steps into the game I get a memory leak notification which later makes the websockets requests fail.
Sep 25, 2017 12:26:19 PM io.netty.util.ResourceLeakDetector reportTracedLeak
SEVERE: LEAK: ByteBuf.release() was not called before it's garbage-collected. See <http://netty.io/wiki/reference-counted-objects.html> for more information.
I'm not sure what could be causing it. I found https://groups.google.com/forum/#!msg/aleph-lib/-41TvS0uKVM/KF7PE_iOErwJ but that should now not happen with the defaults anymore.
Not sure if the stacktrace is visible on slack, I don't have any storage space in my slack workspace :suspect:
Hmmh. This is 0.4.2, right?
Quickly browsing the code, I'm not sure what is supposed to release the bytebufs allocated by client.clj:420
it might help to see what I am doing, might be doing stupid stuff: https://github.com/bbss/cljsc2/blob/master/src/cljsc2/clj/core.clj#L56 create a websocket connection to the starcraft 2 client https://github.com/bbss/cljsc2/blob/master/src/cljsc2/clj/core.clj#L33 put requests on the websocket connection
@miikka uhm, not 0.4.2. it is 0.4.3.
Uh, right. Could you try with 0.4.4-alpha4?
okay, let me try
0.4.4's changelog inculdes "fix memory lead in handling of binary websocket frames"
which sounds promising
that does sound very promising, I should have checked that out myself. Fingers crossed haha.
kiitos @miikka the error seems to be gone!
Has anyone had any experience with using status as a deferred? I'm looking to use aleph for a proxy-like service where the status will also be decided based off an asynchronous request
I guess I can probably let-flow on the status in middleware