[Ovmsdev] "module leaks" subcommand

Stephen Casner casner at acm.org
Sat Jan 19 05:00:15 HKT 2019


I have added a new subcommand "module leaks" is a variant of "module
memory" for use when specifying one or more task names to display the
blocks allocated to those tasks.  The "leaks" variant does not display
the possibly many blocks that were retained from the previous instance
of the command, only those that have been freed or newly allocated; a
count of those blocks is shown instead.  This makes a more compact
display that is expected to be useful when investigating memory leaks.

An example usage follows.  In this example an entry in the locations
config is being modified in such a way that the expected collection of
data elements should be the same afterwards as before.  The lines with
"blocks allocated" and "blocks still allocated", which replace a list
of all the blocks, are what's new.

OVMS# module leaks "OVMS Events"
Free 8-bit 48136/280880, 32-bit 15324/43600, SPIRAM 0/0
--Task--     Total DRAM D/IRAM   IRAM SPIRAM   +/- DRAM D/IRAM   IRAM SPIRAM
no task*           5340      0      0      0      +5340     +0     +0     +0
main*             15936      0      0      0     +15936     +0     +0     +0
esp_timer         52616      0    644      0     +52616     +0   +644     +0
OVMS Events       16088  61776      0      0     +16088 +61776     +0     +0
OVMS DukTape       4256      0      0      0      +4256     +0     +0     +0
OVMS CanRx        20820      0      0      0     +20820     +0     +0     +0
ipc0               7776      0      0      0      +7776     +0     +0     +0
ipc1                 12      0      0      0        +12     +0     +0     +0
Tmr Svc               0     88      0      0         +0    +88     +0     +0
tiT                 112   1520      0      0       +112  +1520     +0     +0
wifi                  0  12732      0      0         +0 +12732     +0     +0
OVMS Console         20      0  27488      0        +20     +0 +27488     +0
mdns                  0    112      0      0         +0   +112     +0     +0
OVMS NetMan           0    276      0      0         +0   +276     +0     +0
============================ blocks dumped = 402
  t=OVMS Events s=77864 in 402 blocks allocated
============================
OVMS# config set locations error "22.0,114, 10 ; enter:homelink:3; leave:acc:mine;enter:notify:messages..."
Parameter has been set.
E (431575) location: location action ACC not valid on leave
E (431575) location: Location error is invalid: 22.0,114, 10 ; enter:homelink:3; leave:acc:mine;enter:notify:messages...
I (431575) location: Location hongkong is at 22.280869,114.160599 (200)
I (431575) location: Location noradius is at 22.000000,114.000000 (100)
I (431585) location: Location noradius2 is at 22.000000,114.000000 (100)
I (431585) location: Location test is at 22.000000,114.000000 (50)
OVMS# module leaks "OVMS Events"
Free 8-bit 48104/280880, 32-bit 15324/43600, SPIRAM 0/0
--Task--     Total DRAM D/IRAM   IRAM SPIRAM   +/- DRAM D/IRAM   IRAM SPIRAM
esp_timer         52628      0    644      0        +12     +0     +0     +0
OVMS Events       16088  61776      0      0        -12    +12     +0     +0
============================ blocks dumped = 402
- t=OVMS Events s=  32 a=0x3ffdb210
- t=OVMS Events s=  12 a=0x3ffdb244
- t=OVMS Events s=  32 a=0x3ffdb264
- t=OVMS Events s=  12 a=0x3ffdb298
----------------------------
  t=OVMS Events s=77812 in 398 blocks still allocated
----------------------------
+ t=OVMS Events s=  32 a=0x3ffdb230  BAAD5601 00000000 3FFDB240 00000001 00000031 3FFDB298 3FFDB1B0 3FFDB210 | .V...... at ..?....1......?...?...?
+ t=OVMS Events s=  12 a=0x3ffdb264  3FFF4638 3FFDB1B0 3FFDB230 BAAD5678 3FFDB2A8 ABBA1234 3FFC1150 00000020 | 8F.?...?0..?xV.....?4...P..? ...
+ t=OVMS Events s=  32 a=0x3ffdb284  BAAD5601 00000001 3FFDB294 00000004 656D6F68 3FFDB100 3FFDB244 3FFDB264 | .V.........?....home...?D..?d..?
+ t=OVMS Events s=  12 a=0x3fff4638  3FFDB1B0 3FFDB264 3FFDB284 BAAD5678 3FFF466D 3FFF47D4 3FFE3DE8 00000010 | ...?d..?...?xV..mF.?.G.?.=.?....
============================
OVMS#

                                                        -- Steve


More information about the OvmsDev mailing list