Hello Duane:
I just applied the change that you recommended.
This is what I've got so far from chumbyflashplayer.x -i myWidget.swf -l383
Adobe FlashLite 3.1.7 Release (Version 9,1,122,0)- Chumby Industries (version 9 build 15-2913 [GCC 4.3.2])
Built for: falconwing; Features: Video ALSA ARM-optimizations
Build time: Tue 02Mar2010 1618
2010-07-31 13:58:00 New display mask = 017f
2010-07-31 13:58:00 GetRegisteredInstancePid(/var/run/chumbyflashplayer.pid) open failed, errno = 2 (No such file or directory)
2010-07-31 13:58:00 ClientSettings()::Dump
2010-07-31 13:58:00 fileName: xmltesting11.swf
2010-07-31 13:58:00 asynchronous load: f
2010-07-31 13:58:00 memory blocks: 384 (12288 K)
2010-07-31 13:58:00 screen_size: 320X240
2010-07-31 13:58:00 screen_stride: 640
2010-07-31 13:58:00 screen_rotate: 0
2010-07-31 13:58:00 screen_update: T
2010-07-31 13:58:00 flash_quality: 2
2010-07-31 13:58:00 sound_buffers: 16
2010-07-31 13:58:00 sound_sample_rate: 44100
2010-07-31 13:58:00 sound_channels: 2
2010-07-31 13:58:00 sound_bytes_per_channel: 2
2010-07-31 13:58:00 sound_samples_per_buffer: 8192
2010-07-31 13:58:00 allowCrossdomain: F
2010-07-31 13:58:00 url_cache_blocks: 4096K
2010-07-31 13:58:00 url_cache_aggression_lvl: 5
2010-07-31 13:58:00 htmlCacheWriteInterval: 60
2010-07-31 13:58:00 htmlCacheStatsFile: (null)
2010-07-31 13:58:00 maxSecondsRuntime: 86400
2010-07-31 13:58:00 preloadCount: 0
2010-07-31 13:58:00 argument_count: 0
2010-07-31 13:58:00 main() - PATH = /bin:/sbin:/lib:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/bin:/usr/chumby/scripts
2010-07-31 13:58:00 BtPlayObject::OpenPipes() - command input = 0x0020b8b8, output = 8
2010-07-31 13:58:00 BtPlayObject::GlobalInit() - btplay active pid 21774
2010-07-31 13:58:00 SoundObject::GlobalInit()
2010-07-31 13:58:01 FrameBuffer::GetDriverValue(enable) - unable to open /proc/driver/chumbyfwfb/enable r/o
2010-07-31 13:58:01 FrameBuffer::SetDriverValue(enable) - failed to open /proc/driver/chumbyfwfb/enable w/o
2010-07-31 13:58:01 HTTPCurlObject::CurlGlobalInit(/usr/share/certs/curl-ca-bundle.crt,true) - enabling SSL
2010-07-31 13:58:01 MouseWheelObject::GlobalInit() - opened wheel device, handle = 14
2010-07-31 13:58:01 GlobalInit() - input event interface supports relative positioning
2010-07-31 13:58:01 Starting flashplayer, use libcurl = Y, HTTPObject::flags = 9
2010-07-31 13:58:01 HTTPCurlObject::CurlMultiInit() returned handle 0021d7b0, HTTPObject::g_globalOptions=9
2010-07-31 13:58:01 ClientObject::ClientObject(this=0x0021e408) asynch load = n
2010-07-31 13:58:01 ClientObject(1) mmobj=0x4059461c, PlatformPlayer=0x4059d0a0
2010-07-31 13:58:01 ChumbyMem::ctor() using heap memory 0x70c00000 size 2048kB
2010-07-31 13:58:01 ChumbyMem::LinkPrivate(mgr=0021d0a8) previous head is 00000000
2010-07-31 13:58:01 DisplayObject::<ctor>(this=70c00024) UDMA is disabled, falling back to /dev/fb[#]
2010-07-31 13:58:01 FrameBuffer::<constructor>(0,320X240) 640 bytes per line, 153600 == buffer size
2010-07-31 13:58:01 FrameBuffer::AssureFrameBuffer() file for /dev/fb0 is 0x220a78 (fileno 15)
2010-07-31 13:58:01 FrameBuffer::AssureFrameBuffer() m_frame_buffer=0x405fb000
2010-07-31 13:58:01 FrameBuffer::GetFrameBuffer(0, 320X240) - creating new FrameBuffer instance 220a10
2010-07-31 13:58:01 DisplayObject::<ctor>(this=70c00024) got fb=00220a10 for 320X240 idx=0 153600 bytes
2010-07-31 13:58:01 SoundObject::SoundObject[a](0x70c0005c mmobj=0x4059461c): initializing audio, buffers=16, bpb=32768
2010-07-31 13:58:01 SoundObject::Add[a](this=0x70c0005c, mmobj=0x4059461c)
2010-07-31 13:58:01 StreamSoundObject::StreamSoundObject(this=0x70c0005c, mmobj=0x4059461c==0x4059461c): setting up audio
2010-07-31 13:58:01 AssureTouchscreen() - input event interface supports absolute axes
2010-07-31 13:58:01 TouchscreenObject::AssureTouchscreen() /dev/input/by-id/soc-noserial-event-ts fd = 17
2010-07-31 13:58:01 TouchscreenObject::ReadSettings() [5 elements] offsetX:204, scaleX:3790, offsetY:3965, scaleY:-3676, xySwapped:0
2010-07-31 13:58:01 KeyboardObject::<ctor>(this=0x70c0012c mmobj=0x4059461c) next=0x00000000
2010-07-31 13:58:01 ClientObject::Initialize() - successfully set vector font data for 24991 bytes
2010-07-31 13:58:01 chumby/keyboard_object.cpp:1631 - ignoring non-USB joystick soc-noserial-event-joystick
2010-07-31 13:58:01 chumby/keyboard_object.cpp:1643 - unknown event type ts, ignoring
2010-07-31 13:58:01 chumby/keyboard_object.cpp:1598 - ignoring soc-noserial-ts
2010-07-31 13:58:01 ClientObject::Initialize() - keyboard is present
2010-07-31 13:58:01 HTTPCacheObject::<constructor> passing memory block 0x40621008 for 4613734 bytes to cache heap manager
2010-07-31 13:58:01 ChumbyMem::ctor() using heap memory 0x40621008 size 4505kB
2010-07-31 13:58:01 ChumbyMem::LinkPrivate(mgr=002a0d28) previous head is 0021d0a8
2010-07-31 13:58:01 ClientObject::constructor - creating global instance of cache manager 002a0ce8
2010-07-31 13:58:01 ClientObject::SWFValidateCommon(url=file:////mnt/usb-AF70-9183/xmltesting11.swf,size=2697) validate result 1
2010-07-31 13:58:01 ClientObject::Initialize() - preloading 1 class libraries
2010-07-31 13:58:01 TRACE: preload.swf v1.02
2010-07-31 13:58:01 ClientObject::Initialize() successfully loaded 1 preinstalled libraries
2010-07-31 13:58:01 SensorObject::SensorObject() g_bend_device 0x2a0d58
2010-07-31 13:58:01 ClientObject::MainLoop() - masterInstance step time = 0, frame interval = 83
2010-07-31 13:58:01 BtPlayObject::Pump(cycle 0) got response OK 1000 flashplayer startup
2010-07-31 13:58:01 BtPlayObject::Pump(cycle 0) got response OK 1001 option songloop 1
2010-07-31 13:58:01 BtPlayDeferredAction::Execute(chkr) - got response 1001
2010-07-31 13:58:01 BtPlayDeferredAction::Execute(chkr) - got response 1000
2010-07-31 13:58:01 BtPlayObject::Pump(cycle 0) got 2 responses, executed 2 deferred actions
2010-07-31 13:58:01 ChumbyPipeObject::ProcessLine() got chumbpipe pid = 22472
2010-07-31 13:58:01 ClientObject::DoTimeCheck() elapsed time = 1280599081s now=1280599081 next check=1280599200
2010-07-31 13:58:01 si_object.cpp:assureTimeZoneOffset(): changed offset from 0 to -14400000, zone=EDT offset=-14400 dst=1
2010-07-31 13:58:01 MemoryStateMonitor::Check() - MemFree=24096kb, Cached=14096kb, Buffers=3724kb, total=41916kb - above danger zone by 29628kb
2010-07-31 13:58:02 SI_Object::SI_OpenSocket(0x4059461c)
2010-07-31 13:58:02 NetStreamRequest::Open(2): Opening protocol 'http://' host 'api.wunderground.com' port 80 location '/auto/wui/geo/GeoLookupXML/index.xml?query=04457'
2010-07-31 13:58:02 NetStreamRequest::Open(2) opened http object id 1
2010-07-31 13:58:02 SocketObject::Step() waiting for connection start time 51840218
2010-07-31 13:58:02 ClientObject::HeartBeat(51840229) elapsed 15.085s prev high 0.000s
2010-07-31 13:58:02 ClientObject::HeartBeat() player running 2s (3014368216)
2010-07-31 13:58:02 SocketObject::Step() socket 21 connect failed, error 111 (Connection refused)
2010-07-31 13:58:03 NetStreamRequest::ProcessHeaders(2) content-type: text/xml
2010-07-31 13:58:03 NetStreamRequest::Step(2) done, closing stream (7361 of 0 bytes, avail=0) status=200 (ok)
2010-07-31 13:58:03 NetStreamRequest::Open(3): Opening protocol 'http://' host 'api.wunderground.com' port 80 location '/auto/wui/geo/GeoLookupXML/index.xml?query=04457'
2010-07-31 13:58:03 NetStreamRequest::Open(3) opened http object id 2
2010-07-31 13:58:03 NetStreamRequest::ProcessHeaders(3) content-type: text/xml
2010-07-31 13:58:03 NetStreamRequest::Step(3) done, closing stream (7361 of 7361 bytes, avail=0) status=0 (ok)
2010-07-31 13:58:04 NetStreamRequest::Open(4): Opening protocol 'http://' host 'api.wunderground.com' port 80 location '/auto/wui/geo/GeoLookupXML/index.xml?query=04457'
2010-07-31 13:58:04 NetStreamRequest::Open(4) opened http object id 3
2010-07-31 13:58:04 NetStreamRequest::ProcessHeaders(4) content-type: text/xml
2010-07-31 13:58:04 NetStreamRequest::Step(4) done, closing stream (7361 of 7361 bytes, avail=0) status=0 (ok)
2010-07-31 13:58:05 NetStreamRequest::Open(5): Opening protocol 'http://' host 'api.wunderground.com' port 80 location '/auto/wui/geo/GeoLookupXML/index.xml?query=04457'
2010-07-31 13:58:05 NetStreamRequest::Open(5) opened http object id 4
2010-07-31 13:58:05 NetStreamRequest::ProcessHeaders(5) content-type: text/xml
2010-07-31 13:58:05 NetStreamRequest::Step(5) done, closing stream (7361 of 7361 bytes, avail=0) status=0 (ok)
The last NetStreamRequest statements repeat every time there is a fetch.
I compared my log with that of RapidFire
(a Weather Underground SWF that fetches weather data every 2 seconds -- stable, no memory leaks detected).
I see two peculiar things:
1. My Log doesn't have a Open(1) request -- Rapidfire does.
2. In my log, the statement "NetStreamRequest::Open(5) opened http object id 4", the open parameter and the object id are off sync, RapidFire has them in sync all the time.
The RapidFire memory usage increases by 4 KB during the first 150 requests (1 request per 2 seconds) and than it stabilizes. On the other hand my application's memory usage it will increase with 24, 60 or even 100 KB.
As for FlashDevelop, i think it uses a different type of trace.
This is what it is now tracing (the source code is the same as you suggested):
Running process: C:\Program Files\FlashDevelop\Tools\fdbuild\fdbuild.exe "D:\workspace\flashdevelop\xmltesting\xmltesting.as2proj" -ipc 99027490-cc0b-45f0-98b0-a293f63fc418 -compiler "C:\Program Files\FlashDevelop\Tools\mtasc" -library "C:\Program Files\FlashDevelop\Library"
Building xmltesting
Build succeeded
Done(0)
~/com/chumby/util/XMLPool.as:52:XMLPool.checkOut(): creating new XML object _root.__xml0
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
~/com/chumby/util/XMLPool.as:84:XMLPool.checkIn(): checking in _root.__xml0 from fetching weather data (1 in, 0 out)
It seems to me that XMLPool is working correctly, however the memory leak is still there.