Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Threads may hang on exit and reserve memory even when MIDlet has completed on S60 2nd Edition (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Tested with
Devices(s): Nokia 6600
Created: User:Technical writer 1 (21 Aug 2007)
Last edited: hamishwillee (23 Oct 2013)


If a MIDlet is running any threads when exiting, the running threads may keep on hanging, thus reserving memory even after the MIDlet has exited.


Before exiting an application with the Exit command or in some other graceful exit situation, all of the threads have to be killed. This can be done either in the destroyApp() method or in some other user-specified method that is called before exiting the MIDlet, for example, something like the following:

public void commandAction(Command c, Displayable d) {
if (c == exitCommand) {
// exit the MIDlet
iRunning = false;
public void run()
while( iRunning )
try{ Thread.sleep(100); }catch( InterruptedException e ){}
This page was last modified on 23 October 2013, at 05:41.
27 page views in the last 30 days.