| Reply | « Previous Thread | Next Thread » |
|
Hello
I'm using an HTTP connection to get an array of bytes, in order to generate and Image later. But when I create the image I detect that nearly 80Kb of RAM goes off! My images are PNG files of about 3Kb. So I don't know where that memory goes. The main problem is that I cannot recover that memory using GC and my app crashed. I'm doing this.. c = (HttpConnection) Connector.open(URL); is = c.openDataInputStream(); int len = (int)c.getLength(); if (len > 0) { data = new byte[len]; is.readFully(data); image = Image.createImage(data, 0, data.length); // Here is the problem data = null; } What I'm doing wrong? Thanks! Kimi |
|
Quote:
In the png file all the data is compressed. When you load the image (on most - if not all - implementations) it is "opened" up into a device-dependent bitmap so it can be drawn fast enough. The memory consumption is normally the resolution of the image multiplied by the color depth of the screen (plus a small constant for the image header). shmoove |
|
precisely.
say you have a 140x140 image, it requires 140x140x4 bytes to be created, which is : 78400 bytes. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| CAknForm/CAknDialog and memory management | ValentinK | General Symbian C++ | 0 | 2006-07-10 21:16 |
| 7650 and 3650 Canvas and FullCanvas memory | marcilgen | Mobile Java General | 5 | 2003-07-08 13:24 |
| Some memory related and other issues | sanjg2k1 | General Discussion | 0 | 2003-07-07 18:38 |
| can not successfully link any sample using .NET | lobotomat | Symbian Tools & SDKs | 2 | 2002-08-20 01:29 |
| 9210 and 9210i java memory | allams | Mobile Java General | 0 | 1970-01-01 02:00 |