Archived:Repeating socket connections with default access point result in Out of Memory exception in the Nokia N95 (Known Issue)

From Nokia Developer 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 N95
Created: User:Technical writer 1 (25 Mar 2008)
Last edited: hamishwillee (25 Jul 2013)


When making several socket connections with a default access point with the Nokia N95, an Out of Memory exception will be thrown. If the socket MIDlet will remain open after the exception, any attempt to connect to the network (for example, by using a Web browser) results in a new Out of Memory exception. However, when using the device's other applications, no exceptions will be thrown, suggesting that the problem is originating from the number of socket connections. After closing the socket MIDlet, connecting to the network with other applications succeeds and no exception will be thrown.

How to reproduce

The problem can be reproduced with a test MIDlet which makes recursive socket connection calls. The basic code for a test MIDlet can be as follows:

 boolean recursive=false
while(!recursive) {
SocketConnection socon = null;
InputStream inputs = null;
OutputStream outputs = null;
socon = (SocketConnection) Connector.open("socket://address.com:portNumber");
outputs = socon.openOutputStream();
inputs = socon.openDataInputStream();
For example, make a GET request for fetching a Web page and write it to the output stream:
StringBuffer req = new StringBuffer(intSize);
req.append("GET ");
.. // Append HTTP, Content type and other data here
int c = inputs.read(); // Read the feedback from the Web to input stream
// Handle the input here
} //closing the while(!recursive) loop

Test procedure:

  1. Install the test MIDlet.
  2. Go to Menu > Settings > Application Manager > <Test MIDlet> > Open > Access Point and select a properly configured Access Point.
  3. Start the test MIDlet.
  4. Allow the MIDlet to access the Internet. After about 150-200 connections an OutOfMemoryError will be thrown and no new socket connections can be made.
  5. Put the test MIDlet in the background. Start the native Web browser and try going to an URL.
  6. Close the test MIDlet and try again to go to an URL using the native Web browser.


No solution for S60 3rd Edition FP1. This is expected to be fixed in future software releases.

This page was last modified on 25 July 2013, at 12:38.
41 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.