Tag Info

New answers tagged


"So I was musing how can I securely change the value so that it isn't available to poking?" you can't. You have no access to the actual memory location where the data is stored, so you can't determine where you're writing. The attempt to overwrite the data is likely to write to another location entirely.


It is not used a lot. In the Pharo 5 image I have open, there are 9 senders of #become:, 7 of which are in unit tests. It is used in the compiler in code generation and in the Fuel serialization library to replace proxies by their content.


How important it is to fix memory leaks depends on the severity of the problem and what else you have to do that is important. My experience is that small memory leaks tend to be rather benign for most applications. The lifetime of a desktop app session is not usually long enough to see any degradation from a small memory leak. If you are writing a server ...


It slows down because it's doing garbage collection. As memory becomes scarce, the garbage collector has to make multiple passes, freeing up memory and trying to coalesce free blocks together to make a large enough heap to continue to operate. Only after it's gone over the whole heap (possibly multiple times) and collected all the free space and still ...


TL;DR - they're equivalent examples at the IL layer. DotNetFiddle makes this pretty to answer as it allows you to see the resulting IL. I used a slightly different variation of your loop construct in order to make my testing quicker. I used: Variation 1: using System; public class Program { public static void Main() { ...


Depending on what compiler you use (I don't even know if C# has more than one), your code will be optimised before being turned into a program. A good compiler will see that you're re-initialising the same variable each time with a different value and manage the memory space for it efficiently. If you were initialising the same variable to a constant each ...

Top 50 recent answers are included