RE: Re: Memory leak (Jim Rudnicki)

"Chris Fox" <[email protected]> Wed, 26 May 2004 17:02:51 -0500
Newsgroups gmane.comp.hardware.microcontrollers.tini
Organization alicit
Message-ID <003201c4436d$30de5570$1401a8c0@CHRISDELL>
Hong -

I am not that  much of a Java guy, so correct me if I am wrong, but running
the garbage collector should never "wipe out variables/objects you don't want
to erase". That's not garbage! You should be able to run the gc any time you
want to, and it should NEVER do anything but free memory and take some CPU
time!

Chris

-----Original Message-----
From: tini-admin-6tN4nzCoH/[email protected] [mailto:tini-admin-6tN4nzCoH/[email protected]] On Behalf Of Hong
Wong
Sent: Wednesday, May 26, 2004 1:14 PM
To: tini-6tN4nzCoH/[email protected]
Subject: [TINI]Re: Memory leak (Jim Rudnicki)


Hello Tom and Jim,

I also have had problems with the memory leaks, mainly because I am performing
socket communications (which are known to have memory leaks when leaving
socket communication open).  My application was to monitor and control a DC
motor via the internet.  You guys can try the experiment at:
http://mechatronics.poly.edu/TINIPaper/

Now for my solution for memory leaks.  I perform a system garbage collect at
subsequent iterations of my main program (i.e., System.gc() command is used).
It does solve my problem with memory leaks however, this manual garbage
collection scheme is quite dangerous since it wipes out large amounts of
memory used by the program (even the variables/objects you don't want to
erase).  Prior to using System.gc, I have tried to null all unused objects
from my program.  However, this did not plug the leak (so to speak). Hopefully
this technique may help solve your problem, Tom (or may make you more
frustrated, depending of the results).  

Thanks for listening

Hong


---------------- Previous Message --------------------
Tom,

I can only offer hope.  This is from my TINI that monitors temperature sensors
on the 1-Wire about every 15 seconds and updates my database:

TINI OS 1.02c

System up time:
      Days: 23
     Hours: 21
   Minutes: 5
   Seconds: 9

Free RAM: 145344

The memory bounces up to a few hundred k and down to under 100 every few
minutes, but it has never crashed.

Jim

----- Original Message -----
From: "Tom Watson" <[email protected]>
To: "tinilist" <tini-6tN4nzCoH/[email protected]>
Sent: Monday, May 24, 2004 3:36 PM
Subject: [TINI]Memory leak


> We just deployed a new version of our application into the pilot sites 
> and it has developed a new problem. The application uses 1-Wire 
> extensively
and
> starts with about 300K of free RAM. After about two days, the average 
> free memory has declined to <64K and one of the threads quits, forcing 
> the watchdog to restart the system. On the good side, it comes back up 
> and operates normally. On the bad side, this cycle repeats every two 
> days.



_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini

_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini