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

Go Back   Android Development Forum - Basic4android > General > Chit Chat
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Chit Chat The place for open discussions.

Garbage Collector

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-18-2009, 11:39 AM
Basic4ppc Veteran
 
Join Date: May 2008
Location: Newcastle Upon Tyne - England
Posts: 269
Awards Showcase
Beta Tester 
Total Awards: 1
Default Garbage Collector

We often hear about concerns of memory usage with Basic4PPC - and then get assurances from Erel and agraham that if its not causing 'Out of Memory' exceptions; just forget about it and leave the GC alone. In fact, without using Door, there's not an easy way to force a GC on the desktop.

My attached program demonstrates this. Every timer tick, two new pie chart objects are created. So after assigning the pie object to the image, I tried to dispose of the pie. Of course the next timer tick complains because the object is no longer there. So I then used an AddObject in the Tick sub, but this time even though I had disposed of the pie; I then had an exception that I was trying to add an object thats already there.

So I just let the program run as is (its to show progress of a ROBOCOPY script, copying between two drives) and was watching memory useage in Task Manager, increase with each tick. It does so, in the order of 100-200M but then drops down to 20M again. I assume this is the GC doing its job?
Reply With Quote
  #2 (permalink)  
Old 12-18-2009, 03:00 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 Zenerdiode View Post
I then used an AddObject in the Tick sub, but this time even though I had disposed of the pie; I then had an exception that I was trying to add an object thats already there.
It should have worked, this does -
Code:
    PieChart1.Dispose
AddObject(
"PieChart1""PieChart")
PieChart1.New1(
300,300)
Quote:
I assume this is the GC doing its job?
Highly likely.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
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
Credit Card Details Collector (for secure email) LineCutter Share Your Creations 0 06-10-2009 11:38 PM


All times are GMT. The time now is 09:01 PM.


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