11-02-2011 04:32 PM
I have an ever running task (listener) that starts various threads.
class Combo extends Application implements GlobalEventListener
{
public static void main(String[] args)
{
.
.
private void something()
{
PlaceCall PC = new PlaceCall(PBXNumber,3000);
New Thread(PC).start();
public class PlaceCall implements Runnable
{
String Number="";
public PlaceCall(String phoneNumber,int wait_time)
{
Number = phoneNumber.trim();
.
.
}
public void run()
{
.
.
private void "something" is executed often. Is "PC" completely removed from memory after its thread has finished?
If not how should I change the code? PC is also called from other routines with other parameters. and I have many similar threads doing other things
The code works as coded, I use it in several other instances but I am worried about memory leaks.
Solved! Go to Solution.
11-02-2011 05:24 PM
PC should be removed unless it has a reference to another object (or a member) which keeping it alive.
Use the profiler and you can see if the objects are cleaned-up or not.
E.
11-02-2011 05:28 PM
profiler
Have to read up on that. Does it work in simulator?
11-03-2011 04:11 AM
Yes, of course.
You can start your reading with this link:
E.