| Reply | « Previous Thread | Next Thread » |
|
as i am designing Action Game i want to create around 10 images concurrently to make my game look reality but as loading some 7 images theres an error unable to excute application
is this thing only comes in emulator or even it will come in real phones? how come to solve the problem? can we flush out classes or images explicitly(forcing Garbage collector)? please help me in this regard.. Thanks in advance Bye John |
| albertjohn |
| View Public Profile |
| Find all posts by albertjohn |
|
If you run out of memory on the 7210 emulator, then chances are you'll run out of memory on the real phone.
You cannot discard classes, but you can discard unwanted image objects, by setting a variable that refers to the object to null. Code:
// load image here
Image img = Image.createImage ("/MyPicture.png");
// ...then use it...
// discard it here
img = null;
If areas of your images can be painted (say, with rectanges of solid colour), then use fillRect() to paint those areas, and cut out only the bits of the images that you can't paint with graphic functions. Graham. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
Hello
Please check from 7210 SDK settings how much your application is taking memory and remember that RunTimeHeap is only 200 kb. |
|
Thanks to Mr.Graham loading whenever the image is needed and unloading it.
i am not using this idea when the image is frquently needed ! ...but will there will be any difference in speed of execution in emulator and in real phone by using this technique? Yes KVM heap size is 200kin 7210 -can we increase the size as that of series-60 emulator also is there any series-60 emulators(Nokia 3650) for testing the game? bye Albert C John
Last edited by albertjohn : 2003-10-08 at 22:39.
|
| albertjohn |
| View Public Profile |
| Find all posts by albertjohn |
|
Yes, loading the image will take processor time, so performance will suffer unless you can find natural pauses in the application when you can load images without it causing a problem.
The alternative might be to need less memory (by making your application smaller!). You can change the size of the heap in the 7210 emulator with the -heapsize option... see the 7210 SDK documentation. But you can't change the size in the real phone, so if your application only works on a Series 40 with 250k of heap, it doesn't work on real Series 40 phones! I don't use Series 60 emulators, so I don't know... take a look in the main forum, I think there is a Series 60 SDK or some such. Graham. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
Once again thanks for replying me
ok i will find the solution for series 60 emulators bye for now Regds Albert C john |
| albertjohn |
| View Public Profile |
| Find all posts by albertjohn |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|