really the big sin of java and .net's GC is they keep wanting to pretend they don't exist. a GC should always be explicit. let me know you are going to stop the world so i can immediately go fail the health check and stop routing jobs to me while i clean up my gigabyte stack of shit

@icedquinn Not sure I agree. The whole point of the GC not being explicit is to reduce human error, and it does a good job at that. Java performance compared to many other interpreted languages is exceptional (not so much .net).

You also do have the ability to "suggest" the invocation of garbage collection should you need to add some explicit control to speed things up. but it rarely makes much of a difference.

@freemo they stop the world without telling the process, which is the sin. nim used an incremental gc (until they rewrote it all to use refcounting :blobcatshrug2:) so we could collect between game frames. the hoard of c# games doesn't scavenge time when its opportune and just framedrops at random ass times.

there's a lot of deployments where its actually fine for the GC to stop the world, it just needs to tell the load balancer about it ahead of time

@icedquinn

> they stop the world without telling the process

No not really. The GC doesnt freeze your program, it is smart enough to work within the idle time most of the time. You'd be hard pressed to get the GC to glitch your program or slow things down compared to manually doing it. If you do it manually and do a really good job in almost all situations I you will likely get improvements so minimal you could barely measure it.

@freemo not talking about the total clock time to collect. ref counting does constantly pay that cost. talking about the response time.

with a GC there i always a threat of sudden syncopation

@icedquinn If you are worried about momentary latency at moments when latency is super critical then use the Java Real-time specification, JSR1

@freemo it's really not that hard to communicate with a GC in the form of

"hey, this is a good stop point. do you want to stop?" and if yes, signal the service down and go to sleep until its done repacking the 8gb heap.

java/c# don't let you do that, though.
Follow

@icedquinn

Java lets you do that.

System.gc()

If you call that it prioritized the GC, except you dont need to stop. you can keep running and the GC will clean up the 8gb heap without needing to stop your program at all (though you are welcome to stop if you have nothign to do and speed up the GC a bit I guess).

@freemo i guess you’re not reading anything i’m saying before responding, because there are only so many ways i can rephrase the following

if gc.needs_to_run: consul.health_check = hcStop defer: consul.health_check = hcGood gc.collect

@icedquinn

Did you read what I said... as I said you can do that... you just have no need to stop and restart the health check. Though you can if you really want to for some reason.

System.gc(), call it when you have downtime, you now just accomplished what you wanted.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.