objeck / objeck-lang

Objeck is a modern object-oriented programming language with functional features tailored for machine learning. It emphasizes expression, simplicity, portability, and scalability. The programming environment consists of a compiler, virtual machine, REPL shell, and command line debugger with IDE plugins.
https://objeck.org
Other
154 stars 11 forks source link

What's wrong with the Objeck VM? #462

Closed ghost closed 5 months ago

ghost commented 7 months ago

I spent hours watching Windows Task Manager. I found that the Objeck VM never gives back memory. It will only allocate more and more memory. The JVM, on the other hand, does give back memory and allocate more when needed.

objeck commented 7 months ago

The virtual machine has a certain amount of free memory, but a portion of that memory is pooled for reuse. Whenever a garbage collection (GC) cycle starts, the runtime checks whether the memory usage is increasing or decreasing. If the memory usage is decreasing, the system releases unused memory. If the usage is increasing, the system may put the memory in cache or release it.

objeck commented 7 months ago

I spent hours watching Windows Task Manager. I found that the Objeck VM never gives back memory. It will only allocate more and more memory. The JVM, on the other hand, does give back memory and allocate more when needed.

If want to send a code example, I'll look at it. The process used for memory stress testing utilizes the CLBG binary tree algorithm.

objeck commented 6 months ago

@iahung2 Thank you, there was a bug!

I initially thought it was related to memory swapping; however, it turned out to be a deadlock condition that I believe was introduced when I "fixed" an SA finding.

Also, I am creating Docker images that will be published between builds.

objeck commented 6 months ago

See #482