11,707 reputation
24163
bio website
location
age
visits member for 3 years, 7 months
seen yesterday

C# developer, pretty standard stuff. SOLID and other such principles drive everything I do for the most part. Other than that, polyglot lover of functional programming in Haskell, F#, Erlang, and javascript. Player of each, master of none.

  • Monads are like buckets, that's what they say anyway.
  • Monoids are easy! I guess?
  • Comonads are just objects... however that works O_o
  • Cartography has nothing to do with these things.

Cheers.


Mar
25
awarded  Enlightened
Mar
20
comment Is CORBA outdated?
they're called cobras...
Mar
20
comment What principle is violated by having a button do two radically different things or screens act radically different depending on the situation
this is like the cannonical case for POLA
Mar
19
comment When is it a good idea to force garbage collection?
Also your second suggestion is talking about compacting a bunch of large objects, but by default in .NET the LOH doesn't have compaction on. You can manually turn it on and try to compact the LOH if you really want I guess, but you should add that detail if you're suggesting people compact their LOH. Alternatively it would make more sense if you're talking about a lot of small objects rather than large objects, because the SOH does do compaction. Though if those objects were only going to be short lived, you really don't want to bloat your Gen1/2 heap with all of them with a collection.
Mar
18
comment When is it a good idea to force garbage collection?
@DanielPryden good point; when I said references I meant meaningfully holds onto, but there are surely optimizations that allow objects to become unrooted mid method when they're no longer relevant. I'll tweak my language there to be a little clearer, good catch.
Mar
18
awarded  Guru
Mar
18
comment When is it a good idea to force garbage collection?
@Den after reading my description above of the mechanics (as I understand them), what would be the benefit as you see it? You clean out a large number of objects - in the SOH (or LOH?)? Did you just cause other threads to pause for this collection? Did that collection just promote twice as many objects to Gen 2 as it cleared out? Did the collection cause compaction on LOH (do you have it turned on?)? How many GC heaps do you have and is your GC in server or desktop mode? GC is a feckin' ice berg, the treachery is below the waters. Just steer clear. I'm not smart enough to comfortably collect.
Mar
18
comment When is it a good idea to force garbage collection?
Your first idea of an ok time is just bad advice in my opinion. Chances are high that there has been a collection recently so your attempt at collecting again is simply going to arbitrarily promote objects to later generations, which is almost always bad. Later generations have collections that take longer to begin with, increasing their heap sizes "to clear out as much space as possible" just causes this to be more problematic. Plus if you're about to increase memory pressure with a load, you're likely to begin inducing collections anyway, which will run more slowly because increased Gen1/2
Mar
18
awarded  Good Answer
Mar
18
awarded  Nice Answer
Mar
18
comment When is it a good idea to force garbage collection?
I'm going to win simply by having pushed you so far below the fold :D neener neener!
Mar
18
revised When is it a good idea to force garbage collection?
added 180 characters in body
Mar
18
revised When is it a good idea to force garbage collection?
added 181 characters in body
Mar
18
revised When is it a good idea to force garbage collection?
added 181 characters in body
Mar
18
revised When is it a good idea to force garbage collection?
added 181 characters in body
Mar
18
revised When is it a good idea to force garbage collection?
added 181 characters in body
Mar
18
comment When is it a good idea to force garbage collection?
@FlorianMargaine yeah... saying anything about "GC" across all implementations really doesn't make sense..
Mar
18
answered When is it a good idea to force garbage collection?
Mar
16
comment Why don't we have a default character for the opposite of 0?
This question is off topic because WAT?
Mar
16
comment Finding the first subarray that sums to a given total
Not sure this works. Try and find the sum "400" in O(n) given this list: -1 -4 -90 -2 -22 -44 -1231 -1 -1 -900 -4 500 -100