Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Images and memory

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2008, 02:40 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 91
Default Images and memory

Hi,
I have an app where maps will be displayed. Before I show the map it will be stored in an imagelist an than displayed with the imagelib
Code:
drawer.DrawImage1(ImageList1.Item(0),rectSrc.Value,rectDest.Value,false)
When this map is "finished" a new map will be opened. The imagelist will be cleared and the new map uses index 0 again and so on. Looking at the taskmanager the memory increases very fast. I feel that the new map doesn’t replace the old one; the new will be added to the video memory. After a while I get a problem with my RAM (2GB). How can I delete the old images in the video memory?
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, Win7
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: iblue 747
Reply With Quote
  #2 (permalink)  
Old 02-23-2008, 04:58 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by wolfgang View Post
After a while I get a problem with my RAM (2GB).
Can you describe the problem you get with your RAM? The .NET Garbage Collector should be looking after reclaiming memory once you have finished with it. You don't have another reference to each image, other than the ImageList, which might be making the GC think the memory is still in use do you?
Reply With Quote
  #3 (permalink)  
Old 02-23-2008, 05:37 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 91
Default

Hi agraham,
I have another reference to imagelist because I draw direct on this image. Reference is:
Code:
track.New2(ImageList1.Item(0),B4PObject(5))
and I found that the reference has to be set again after an new images was loaded. But I can't find a command to delete or dispose a drawer object. I have had the same problen on the device and I catched it with an error handler and repeated deleting imagelist and problem was solved. This is the part the error occurs on PC (after a lot of loadings, but always index 0):
Code:
Sub btdel_Click
    
If Not(tbtrack.Text = "enter track"Then
        
If Msgbox("Delete current track/trace?","Delete",cMsgBoxYesNo,cMsgBoxQuestion) = cYes Then
            ImageList1.Clear
            ImageList1.Add(OpenDialog1.File)
            track.New2(ImageList1.Item(
0),B4PObject(5))
.
.
.
Sometimes I reload the same file to correct some wrong drawings.
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, Win7
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: iblue 747
Reply With Quote
  #4 (permalink)  
Old 02-23-2008, 05:41 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should use track.Dispose.
Before initializing it again you will need to add it with AddObject("track","Drawer").
Reply With Quote
  #5 (permalink)  
Old 02-23-2008, 05:52 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 91
Default track.Dispose?

Thank you Erel,
that's what I'm looking for but I can't find it. Are there other undocumentd commands which would be very usefull?
I'll give it a try.
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, Win7
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: iblue 747
Reply With Quote
  #6 (permalink)  
Old 02-23-2008, 06:08 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

All objects support the Dispose method.
It is noted under Main Help - External Libraries.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dim memory usage JamesC Questions (Windows Mobile) 2 07-21-2008 09:09 AM
Performance vs Memory RandomCoder Questions (Windows Mobile) 4 02-10-2008 05:03 PM
Windows Vista and USB-memory BjornF Chit Chat 3 01-12-2008 04:44 PM
How much memory remains? willisgt Questions (Windows Mobile) 1 12-05-2007 08:55 AM
Memory Usage Scubaticus Questions (Windows Mobile) 6 07-03-2007 06:37 PM


All times are GMT. The time now is 10:14 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0