How to reduce memory usage in a Haskell app?

Lists are not the best datastructure for this type of code (with lots of (++), and (last)). You lose a lot of time constucting and deconstructing lists. I’d use Data.Sequence or arrays, as in C versions. There is no chance for thunks of makeu0 to be garbage-collected, since you need to retain all of them … Read more

Does jmap force garbage collection when the live option is used?

In order to determine liveness, Java has to run full GC, so yes, it does. To put the question to sleep… here is the answer, if anyone needs to dig deeper. Feel free. part of /hotspot/agent/src/share/vm/services/attachListener.cpp taken from openjdk http://download.java.net/openjdk/jdk7/ and you must accept http://www.gnu.org/licenses/gpl-2.0.html // Implementation of “inspectheap” command // // Input arguments :- … Read more

Garbage Collection and Parallel.ForEach Issue After VS2015 Upgrade

This indeed performs excessively poorly, the background GC is not doing you favor here. First thing I noted is that Parallel.ForEach() is using too many tasks. The threadpool manager misinterprets the thread behavior as “bogged down by I/O” and starts extra threads. This makes the problem worse. Workaround for that is: var options = new … Read more

Why should we call SuppressFinalize when we don’t have a destructor

I’m going out on a limb here, but… most people don’t need the full-blown dispose pattern. It’s designed to be solid in the face of having direct access to unmanaged resources (usually via IntPtr) and in the face of inheritance. Most of the time, neither of these is actually required. If you’re just holding a … Read more

Monitoring Garbage Collector in C#

I don’t see GC.RegisterForFullGCNotification(int,int) anywhere in your code. It looks like you’re using the WaitForFullGC[xxx] methods, but are never registering for the notification. That’s probably why you’re getting the NotApplicable status. However, I’m doubting that GC is your problem, while possible, I suppose it would be good to know about all of the GC modes … Read more

Killing a thread when MVar is garbage collected

It will just work: when the MVar is only reachable by the thread that is blocked on it, then the thread is sent the BlockedIndefinitelyOnMVar exception, which will normally cause it to die silently (the default exception handler for a thread ignores this exception). BTW, for doing some cleanup when the thread dies, you’ll want … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)