Follow

I've just removed a line with "gc.collect()" in work codebase and everything became way and less resource hungry. That is why you shouldn't put it everywhere you want!

· tootstream · 2 · 0 · 1

@kungtotte Definitely it is. The more I work the more I see such cases everywhere in software development. Write code to be fast, but readable and then look for issues

@alexcleac One of the more promising experimental Java garbage collectors has a flag that makes that do absolutely nothing. 😉

@alexcleac So something like gc.collect = ()->{} could kill everything, no?

@gudenau Not exactly. gc.collect just asks garbage collector to start collecting. And it stops the interpreter to understand, what is garbage and what is not. However, there are 2GiB of data. A lot to process

@alexcleac I'm sure a lot it could be done without a pause, but it's Python. :^)

@gudenau all the concurrent garbage collectors are way slower than interpreter pause, and it reduces speed of execution. Some time ago I was reading about Java's GC and author told that sometimes it is faster to completely stop execution and to the garbage collection than do it in paralel.

@alexcleac But if you have a large heap the pause can become quite large. And for things that I am interested in (games basically) that is quite bad.

Different points of view eh?

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!