I've been programming in ActionScript for about 6 years now but never heard of the term 'garbage collection' until AS3 came out. Why do we have to worry about it now, and never before? And what, precisely, is it? From what I've read/heard, it has something to do with memory management/leaks, etc. -- and even that I don't understand much ...
I have created some python code which creates an object in a loop, and in every iteration overwrites this object with a new one of the same type. This is done 10.000 times, and Python takes up 7mb of memory every second until my 3gb RAM is used. Does anyone know of a way to remove the objects from memory?
...
I have the following code (cut down for readability):
Main Class:
public StartProcess()
{
Thinker th = new Thinker();
th.DoneThinking += new Thinker.ProcessingFinished(ThinkerFinished);
th.StartThinking();
}
void ThinkerFinished()
{
Console.WriteLine("Thinker finished");
}
Thinker Class:
public class Thinker
{
p...
While talking to a colleague about a particular group of apps using up nearly 1.5G memory on startup... he pointed me to a very good link on .NET production debugging
The part that has me puzzled is ...
For example, if you allocate 1 MB of
memory to a single block, the large
object heap expands to 1 MB in size.
When you free t...
I've created an object called loginInterface in flex builder. When this object is initialized it loads the login interface, creating buttons, input boxes and so on.
I created a method for this object called unload. I also have a method which returns whether the interface has been loaded yet. Now, I want to unload the object so that the ...
When the JVM runs with the -XX:+UseParNewGC we are getting an occasional access violation.
When we look at the dump file, we see
Heap
par new generation total 14784K, used 13689K [0x02bd0000, 0x03bd0000, 0x06950000)
eden space 13184K, 100% used [0x02bd0000, 0x038b0000, 0x038b0000)
from space 1600K, 31% used [0x03a40000, 0x03abe6...
I was wondering how a Garbage Collector can be implemented with C++ full power of pointers arithmetic. Also, In languages like Java, I can not assign literal addresses to references. In C++ it is very flexible.
I believe that C# has both, but again, the unsafe pointer in C# is the responsibility of the programmer.
EITD :: guys, I am as...
UPDATED QUESTION
Since the ctor is not supported by .NETCF (public FileStream(IntPtr handle, FileAccess access). Could you please suggest other ways of sharing large file in memory between managed and unmanaged code on a limited resource (RAM) platform. Basically I want to map the file in the upper region of 2GB user space (Win CE 5.0) ...
Hi I am using a lot of temporary files in java and my problem is that they do not get deleted.
Without having to implement my own handling of temporary file management (not hard I grant you but I am lazy plus with so many things to do If I can save reinventing the wheel for this all the better) is there a way to ensure the temp files on...
We have a j2ee application running on Jboss and we want to monitor its memory usage. Currently we use the following code
System.gc();
long usedMB = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
logger.information(this, "memory usage" + usedMB);
This code works fine. That means it shows memory curve which corresponds...
If not, are there any plans to add Garbage Collection to the iPhone?
Related question: This question from January (pre OS 3.0) says the iPhone had no GC at the time.
Thanks!
...
When I have an object, removing all references to it is enough to sign it up for the garbage collector, atleast that's what I heard. Eg.:
removeChild(object);
object = null;
I'm still a bit confused though, because does this mean that the event listeners made inside this object's instance are also automatically removed? Or is there an...
This is a problem I have been trying to track down for a couple months now. I have a java app running in that processes xml feeds and stores the result in a database. This has been giving intermittent resource problems that are very difficult to track down.
Background:
On the production box (where the problem is most noticeable), i do n...
If i have an array say -
int[] a = new int[10];
does the Java GC when doing its collection see that as 10 objects or a single object?
Update:
so according to the given answers, looking at it from a GC perspective isnt it more efficient that instead of
List l;
for(i =0;i<1000;i++)
l.add(new MyObj(343,"asdfasfd"));
we should d...
If my software has two object instances, one of which is subscribed to the events of the other. Do I need to unsubscribe them from one another before they are orphaned for them to be cleaned up by the garbage collector? Or is there any other reason why I should clear the event relationships? What if the subscribed to object is orphaned b...
I'm writing a little network application in Cocoa, using objective-c 2.0. I have the garbage collector enabled in required mode (-fobjc-gc-only). When I run the code most of the time it works like a charm. But sometimes it just crashes without warning, and gdb launches. I'm as yet unable to get any useful info from GDB. The code is as fo...
Calling System.gc() requests that garbage collection takes place, and isn't guaranteed. The part about it not being guaranteed is interesting to me: can someone explain the exact process that takes place when you make this call?
...
If object A listens to an event from object B, object B will keep object A alive.
Is there a standard implementation of weak events that would prevent this?
I know WPF has some mechanism but I am looking for something not tied to WPF.
I am guessing the solution should use weak references somewhere.
...
I apologize if the answer to this question is trivial. But I still cannot figure out this by myself.
How does the garbage collector in .NET identify what objects on the heap are garbage and what objects are not?
Lets say a .NET application is running and at a certain point of time garbage collection occurs(lets leave out the generatio...
When my task manager (top, ps, taskmgr.exe, or Finder) says that a process is using XXX KB of memory, what exactly is it counting, and how does it get updated?
In terms of memory allocation, does an application written in C++ "appear" different to an operating system from an application that runs as a virtual machine (managed code like ...