Hi,
Can someone please tell me whether AddB below will result in less CLR allocations than AddA? I've examined disassembly and it looks to be the case but I'd like confirmation from the Experts please. Can someone Exchange this information with me please?
Cheers,
Charlie.
namespace A
{
struct Vec2
{
public float x;
...
Hello all,
Are there any memory leaks when I throw exception from contructor like this:
class Wictim
{
public string var1 = "asldslkjdlsakjdlksajdlksadlksajdlj";
public Wictim()
{
//throw new Exception("oops!");
}
}
Will the failing objects be collected by garbage collector.
...
If I do the following:
public class Test
{
public static void Main()
{
List<Person> persons = new List<Person> { new Person() };
persons[0].Sneezing += new EventHandler(Person_Sneezing);
persons = null;
}
public static void Person_Sneezing(object sender, EventArgs e)
{
(sender as Person).CoverFace();
}
}
Does the pers...
Hi,
i have a cache that uses WeakReferences to the cached objects to make them automatically removed from the cache in case of memory pressure. My problem is that the cached objects are collected very soon after they have been stored in the cache. The cache runs in a 64-Bit application and in spite of the case that more than 4gig of mem...
This piece of code was split off from a project I am working on. It consistently reproduces a garbage collection error on my Mac OS 10.5.7 and sometimes crashes. I have been looking at it for too long so my question is: does anybody else see why this would give errors when garbage collection is on?
- (void) doCrash: (id) sender
{
NS...
How are the objects created or used in a P/invoke function or RCW native function are released/disposed?
will .Net GC take care of that?
Does GC have any control over those objects?
Is it the developers sole responsibility to release/dispose those objects by calling their .Close() or .Release() methods?
Please guide me.
Thanks and ...
I just realized for my cocoa application I can set the garbage collector setting for the target but also for the project.
My app did crash since I activated GB only in the project properties not in the target properties like I used to do. Changes in the project settings did not apply to the target settings. What use is the Garbage Coll...
Hi all,
Has anyone implement this new feature in .net 3.5 SP1 in an asp.net environment? The only thing I can find the web is this, which is not an actual implementation.
...
My application allocates a large amount of memory (millions of small objects totaling several gigabytes) and holds onto it for a long time.
Is .NET wasting time checking through all of this data to do GC on it?
How often does the Gen 2 GC occur (the one that checks all objects)?
Is there any way to reduce it's frequency or temporarily ...
I have read a lot of .NET performance articles that describe Gen1,Gen2 garbage collection and objects surviving the generations.
Why does objects survives the collection?
What is pinning?
How do I learn more about this?
...
I use the following method in a piece of production code:
private void DownloadData(Uri uri)
{
WebClient webClient = new WebClient();
DownloadDataCompletedEventHandler eh = null;
eh = delegate(object sender, DownloadDataCompletedEventArgs e)
{
webClient.DownloadDataCompleted -= eh;
...
In addition to mark-and-sweep, the garbage collectors for .Net and Java both also run a compaction phase to cut down on memory fragmentation. I am not able to find any documentation on a compaction/defragmentation phase for the Flash 9 garbage collector - does Flash not have any compaction phase?
...
Hi, I'm starting to program a javascript tower defense; so far i have the movement of the minions over a trajectory. But I have a very big trouble, the game suddenly freezes for a couple of seconds. I'm guessing that is the garbage collector doing its job, any ideas on how i can solve this will be very good since i plan on adding a lot m...
My program has 7,667,712 bytes of committed heap, yet it has 33,546,240 reserved heap bytes! I can see that the program is using around 44 MB of private bytes. How can I get the .NET GC to reserve less space for the managed heap?
...
What happens if you save a reference to the current object during the finalize call? For example:
class foo {
...
public void finalize() {
bar.REFERENCE = this;
}
}
Is the object garbage-collected, or not? What happens when you try to access bar.REFERENCE later?
...
I want to make some data easily available throughout my application. I have a few variables in a class with static data, which get written to and read from at several different points.
This worked fine for a while, but now at one point where I expect to be able to retrieve an ArrayList all I get is "null".
I am wondering if the static ...
Ruby is slow at certain things. But what parts of it are the most problematic?
How much does the garbage collector affect performance? I know I've had times when running the garbage collector alone took several seconds, especially when working with OpenGL libraries.
I've used matrix math libraries with Ruby that were particularly slo...
I'm trying to make sure that my understanding of IDisposable is correct and there's something I'm still not quite sure on.
IDisposable seems to serve two purpose.
To provide a convention to "shut down" a managed object on demand.
To provide a convention to free "unmanaged resources" held by a managed object.
My confusion comes from ...
Consider the following code snippet
import qualified Foreign.Concurrent
import Foreign.Ptr (nullPtr)
main :: IO ()
main = do
putStrLn "start"
a <- Foreign.Concurrent.newForeignPtr nullPtr $
putStrLn "a was deleted"
putStrLn "end"
It produces the following output:
start
end
I would had expected to see "a was deleted" some...
In Java:
I have an object that holds references to 2 daemon threads. I am considering the corner case where it is not deinitialized, so I can determine whether I need a finalizer. The function for detinitializing stops the threads. I could go ahead and just add a finalizer but I am curious:
a) Can the object get garbage collected while...