Namespaces
Variants
Actions

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

Jump to: navigation, search
Archived.png
Archived: 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

Compatibility
Platform(s): S60 3rd Edition Feature Pack 1

Article
Created: User:Technical writer 1 (25 Mar 2008)
Last edited: hamishwillee (28 Jun 2012)

Description

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
outputs.write(req.toString().getBytes());
outputs.flush();
..
int c = inputs.read(); // Read the feedback from the Web to input stream
..
// Handle the input here
..
inputs.close();
outputs.close();
socon.close();
 
} //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.


Solution

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

This page was last modified on 28 June 2012, at 08:51.
383 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved