Why is our MonoTouch app breaking in the garbage collector? It is not out of memory
Thanks to your reproduction we have found and corrected a very obscure issue in the garbage collector. It will be included in MonoTouch 4.0.2.
Thanks to your reproduction we have found and corrected a very obscure issue in the garbage collector. It will be included in MonoTouch 4.0.2.
You have made Update a virtual function, suggesting that derived classes may override the implementation of Update. This introduces two big risks. 1.) An overridden implementation may remember to do a World.Remove, but may forget the delete this. The memory is leaked. 2.) The overridden implementation calls the base-class Update, which does a delete this, … Read more
For a detailed explanation of compressed oops, see the “Compressed oops in the Hotspot JVM” article by John Rose @ Oracle. The TL;DR version is: on modern computer architectures, memory addresses are byte addresses, Java object references are addresses that point to the start of a word1, on a 64-bit machine, word alignment means that … Read more
If you create the figure without using plt.figure, then it should be reference counted as you expect. For example (This is using the non-interactive Agg backend, as well.) from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure # The pylab figure manager will be bypassed in this instance. # This means that `fig` will … Read more
Your code will work fine: the weak reference will not cause a retain cycle as you explicitly instruct ARC not to increase the retainCount of your weak object. For best practice, however, you should create a strong reference of your object using the weak one. This won’t create a retain cycle either as the strong … Read more
From the docs about __block __block variables live in storage that is shared between the lexical scope of the variable and all blocks and block copies declared or created within the variable’s lexical scope. Thus, the storage will survive the destruction of the stack frame if any copies of the blocks declared within the frame … Read more
Here’s a list of resources I had noted down. Some of these explain how the heap/garbage collection works and some have details on how to configure everything. IBM How does garbage collection work? Detailed description of garbage collection Generational and concurrent garbage collection Sun Turbo-charging Java HotSpot Virtual Machine, v1.4.x to Improve the Performance and … Read more
Allocations >= 85 KB go onto the LOH. Compacting the LOH is not bad — it’s just that LOH fragmentation isn’t something the great majority of apps need to worry about, so for them it’s not worth the expense of compacting. Fragmentation occurs when you allocate several large objects and they all get taken from … Read more
There is no built-in ADO.Net functionality to handle this really gracefully for large data. The problem is two fold: there is no API to ‘write’ into a SQL command(s) or parameters as into a stream. The parameter types that accept a stream (like FileStream) accept the stream to READ from it, which does not agree … Read more
Perhaps you should include a complete simple example. (If I compile your code above and run it by itself, on linux, I get a seg fault at the second cudaMalloc operation). One wrinkle I see is that since you have in the first step allocated the particle objects in device memory, when you go to … Read more