Heap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 640 │ 1 │ external byte array │
│ 2088 │ 12 │ tls/bignum │
│ 53248 │ 15 │ toit processes │
│ 16384 │ 4 │ system 0 b476094f-1061-696e-a209-3f0ad2a0162d │
│ 24576 │ 6 │ current 1 68a2c931-1e01-4f20-cfbd-6a64b500a955 │
│ 12288 │ 3 │ other 2 836308cc-d8d0-e73d-6648-17a1bcd6d444 │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 6088 │ 21 │ lwip │
│ 9608 │ 837 │ heap overhead │
│ 1944 │ 29 │ event source │
│ 50280 │ 390 │ thread/other │
│ 30984 │ 25 │ thread/spawn │
│ 51368 │ 226 │ untagged │
│ 11936 │ 56 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 238664 bytes in 775 allocations (93%), largest free 2k, total free 19k
envelope: esp32-no-ble
import ble
import net
import http
import encoding.hex
import certificate-roots
import artemis
SCAN-DURATION ::= Duration --s=20
main args:
certificate-roots.install-common-trusted-roots
adapter := ble.Adapter
central := adapter.central
network := net.open
client := http.Client network
headers := http.Headers
if args[1] == null or args[1] == "":
throw "Authorization header is required"
exit 1
headers.add "Authorization" args[1]
headers.add "Device-ID" artemis.device.id.to-string
try:
session := client.web-socket --uri=args[0] --headers=headers // ws://192.168.0.58:8080/ws
try:
central.scan --duration=SCAN-DURATION: | device/ble.RemoteScannedDevice |
session.send (hex.encode device.data.manufacturer-data)
finally:
session.close
finally:
network.close
Heap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 2176 │ 2 │ external byte array │
│ 16936 │ 23 │ tls/bignum │
│ 49152 │ 14 │ toit processes │
│ 16384 │ 4 │ system 0 b476094f-1061-696e-a209-3f0ad2a0162d │
│ 24576 │ 6 │ other 1 68a2c931-1e01-4f20-cfbd-6a64b500a955 │
│ 8192 │ 2 │ current 4 836308cc-d8d0-e73d-6648-17a1bcd6d444 │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 8048 │ 25 │ lwip │
│ 8136 │ 657 │ heap overhead │
│ 1968 │ 30 │ event source │
│ 44592 │ 186 │ thread/other │
│ 36600 │ 29 │ thread/spawn │
│ 52344 │ 228 │ untagged │
│ 12232 │ 59 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 252664 bytes in 596 allocations (98%), largest free 1k, total free 6k
central.scan
[artemis.scheduler] INFO: job started {job: container:tracker}
Heap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 2176 │ 2 │ external byte array │
│ 16936 │ 23 │ tls/bignum │
│ 53248 │ 15 │ toit processes │
│ 20480 │ 5 │ system 0 b476094f-1061-696e-a209-3f0ad2a0162d │
│ 24576 │ 6 │ other 1 68a2c931-1e01-4f20-cfbd-6a64b500a955 │
│ 8192 │ 2 │ current 12 836308cc-d8d0-e73d-6648-17a1bcd6d444 │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 6080 │ 21 │ lwip │
│ 8136 │ 657 │ heap overhead │
│ 1968 │ 30 │ event source │
│ 45584 │ 206 │ thread/other │
│ 36600 │ 29 │ thread/spawn │
│ 50536 │ 225 │ untagged │
│ 12232 │ 59 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 253976 bytes in 610 allocations (99%), largest free 2k, total free 5k
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.142>
******************************************************************************
Allocation failed:.
0: Session.read-handshake-message_ <sdk>/tls/session.toit:640:15
1: Session.handshake_.<block> <sdk>/tls/session.toit:338:11
2: Task_.with-deadline_.<block> <sdk>/core/task.toit:223:16
3: Task_.with-deadline_ <sdk>/core/task.toit:217:3
4: with-timeout <sdk>/core/utils.toit:182:24
5: with-timeout <sdk>/core/utils.toit:165:12
6: Session.handshake_ <sdk>/tls/session.toit:337:9
7: Session.handshake.<block> <sdk>/tls/session.toit:281:7
8: Session.handshake <sdk>/tls/session.toit:227:3
9: Socket.handshake <sdk>/tls/socket.toit:69:14
10: Client.try-to-reuse_.<block>.<block> <pkg:pkg-http-2.5.1>/client.toit:651:24
11: catch.<block> <sdk>/core/exceptions.toit:124:10
12: catch <sdk>/core/exceptions.toit:122:1
13: catch <sdk>/core/exceptions.toit:85:10
14: Client.try-to-reuse_.<block> <pkg:pkg-http-2.5.1>/client.toit:646:9
15: Client.try-to-reuse_ <pkg:pkg-http-2.5.1>/client.toit:634:3
16: Client.web-socket_.<block> <pkg:pkg-http-2.5.1>/client.toit:367:7
17: SmallInteger_.repeat <sdk>/core/numbers.toit:1194:3
18: Client.web-socket_ <pkg:pkg-http-2.5.1>/client.toit:364:19
19: Client.web-socket <pkg:pkg-http-2.5.1>/client.toit:336:12
20: main.<block> Client/tracker.toit:27:23
21: main Client/tracker.toit:10:1
******************************************************************************
[artemis.scheduler] INFO: job stopped {job: container:tracker}
[artemis.synchronize] INFO: synchronized
[artemis.synchronize] INFO: synchronized
[artemis.synchronize] INFO: synchronized
import artemis
main args:
with-timeout (Duration --m=2):
artemis.run --offline: actual-main args
actual-main args: // Original main
...
│ 24576 │ 6 │ other 1 68a2c931-1e01-4f20-cfbd-6a64b500a955 │
│ 8192 │ 2 │ current 12 836308cc-d8d0-e73d-6648-17a1bcd6d444 │
DEBUG: current state is changed {changes: { apps: +{tracker: {id: 836308cc-d8d0-e73d-6648-17a1bcd6d444, triggers: {interval: 60}, arguments: [wss://..., ...]}} }}
Heap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 1536 │ 1 │ external byte array │
│ 36864 │ 11 │ toit processes │
│ 16384 │ 4 │ system 0 d76b3d7e-9719-6d20-835d-fac4a92e544c │
│ 12288 │ 3 │ current 1 224bbb94-c28a-2f47-fd16-27d72746f31f │
│ 8192 │ 2 │ other 2 22d830b6-90fa-da4b-ef98-ea7d9a1659cf │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 34752 │ 72 │ lwip │
│ 8104 │ 648 │ heap overhead │
│ 2024 │ 29 │ event source │
│ 41752 │ 153 │ thread/other │
│ 31000 │ 25 │ thread/spawn │
│ 49992 │ 230 │ untagged │
│ 11952 │ 56 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 238456 bytes in 577 allocations (93%), largest free 28k, total free 41k
Total: 238456 bytes in 577 allocations (93%), largest free 28k, total free 41k
jag container install tracker ./Client/tracker.toit
jag container list
DEVICE IMAGE NAME
lucid-silver 22d830b6-90fa-da4b-ef98-ea7d9a1659cf tracker
lucid-silver 224bbb94-c28a-2f47-fd16-27d72746f31f jaguar
[jaguar] INFO: container 'tracker' installed and started
Heap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 56 │ 2 │ tls/bignum │
│ 45056 │ 13 │ toit processes │
│ 16384 │ 4 │ system 0 d76b3d7e-9719-6d20-835d-fac4a92e544c │
│ 20480 │ 5 │ other 1 224bbb94-c28a-2f47-fd16-27d72746f31f │
│ 8192 │ 2 │ current 3 22d830b6-90fa-da4b-ef98-ea7d9a1659cf │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 6152 │ 24 │ lwip │
│ 7776 │ 613 │ heap overhead │
│ 1944 │ 29 │ event source │
│ 44480 │ 173 │ thread/other │
│ 36600 │ 29 │ thread/spawn │
│ 48808 │ 223 │ untagged │
│ 11960 │ 56 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 223312 bytes in 549 allocations (87%), largest free 4k, total free 35k
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.143>
******************************************************************************
MALLOC_FAILED error.
0: Session.handshake.<block> <sdk>/tls/session.toit:281:7
1: Session.handshake <sdk>/tls/session.toit:227:3
2: Socket.handshake <sdk>/tls/socket.toit:69:14
3: Client.try-to-reuse_.<block>.<block> <pkg:pkg-http-2.5.1>/client.toit:651:24
4: catch.<block> <sdk>/core/exceptions.toit:124:10
5: catch <sdk>/core/exceptions.toit:122:1
6: catch <sdk>/core/exceptions.toit:85:10
7: Client.try-to-reuse_.<block> <pkg:pkg-http-2.5.1>/client.toit:646:9
8: Client.try-to-reuse_ <pkg:pkg-http-2.5.1>/client.toit:634:3
9: Client.web-socket_.<block> <pkg:pkg-http-2.5.1>/client.toit:367:7
10: SmallInteger_.repeat <sdk>/core/numbers.toit:1194:3
11: Client.web-socket_ <pkg:pkg-http-2.5.1>/client.toit:364:19
12: Client.web-socket <pkg:pkg-http-2.5.1>/client.toit:336:12
13: main.<block> Client/tracker.toit:27:23
14: main Client/tracker.toit:10:1
******************************************************************************
[jaguar] INFO: container 'tracker' installed and started
Heap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 224 │ 1 │ tls/bignum │
│ 45056 │ 13 │ toit processes │
│ 16384 │ 4 │ system 0 d76b3d7e-9719-6d20-835d-fac4a92e544c │
│ 20480 │ 5 │ current 1 224bbb94-c28a-2f47-fd16-27d72746f31f │
│ 8192 │ 2 │ other 4 b09117fb-db68-76de-da22-b464f69cbfd7 │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 29464 │ 54 │ lwip │
│ 12288 │ 1171 │ heap overhead │
│ 2024 │ 29 │ event source │
│ 56872 │ 704 │ thread/other │
│ 31008 │ 25 │ thread/spawn │
│ 48808 │ 223 │ untagged │
│ 11952 │ 56 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 258176 bytes in 1105 allocations (101%), largest free 0k, total free 0k
Heap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 224 │ 1 │ tls/bignum │
│ 45056 │ 13 │ toit processes │
│ 16384 │ 4 │ system 0 d76b3d7e-9719-6d20-835d-fac4a92e544c │
│ 20480 │ 5 │ current 1 224bbb94-c28a-2f47-fd16-27d72746f31f │
│ 8192 │ 2 │ other 4 b09117fb-db68-76de-da22-b464f69cbfd7 │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 29464 │ 54 │ lwip │
│ 12360 │ 1180 │ heap overhead │
│ 2024 │ 29 │ event source │
│ 57120 │ 714 │ thread/other │
│ 31008 │ 25 │ thread/spawn │
│ 48808 │ 223 │ untagged │
│ 11952 │ 56 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 258496 bytes in 1115 allocations (101%), largest free 0k, total free 0k
[jaguar] WARN: running Jaguar failed due to 'OUT_OF_MEMORY' (1/3)
net/http
gorilla/websockets
Total: 238456 bytes in 577 allocations (93%), largest free 28k, total free 41k
│ 57120 │ 714 │ thread/other │
│ 31008 │ 25 │ thread/spawn │
│ 48808 │ 223 │ untagged │
import system show serial-print-heap-report
main:
serial-print-heap-report
adapter := ble.Adapter
session := client.web-socket --uri="wss://crowdtracker.hamp.sh/api/report" --headers=headers // ws://192.168.0.58:8080/ws
print "After WS connection, before BLE scan"
serial-print-heap-report
adapter := ble.Adapter
close
ble.ble-close_ adapter.resource-group_
close
Adapter
try:
try:
central.scan --duration=SCAN-DURATION: | device/ble.RemoteScannedDevice |
// session.send (hex.encode device.data.manufacturer-data)
devices.add (hex.encode device.data.manufacturer-data)
finally:
print "After BLE scan"
serial-print-heap-report
ble.ble-close_ adapter.resource-group_
print "After BLE close"
serial-print-heap-report
session.send (json.encode {
"devices": devices
})
print "After WS send"
session.close
print "After WS close"
finally:
network.close
import artemis
import ble
import certificate-roots
import encoding.hex
import http
import net
SCAN-DURATION ::= Duration --s=20
main args:
with-timeout (Duration --m=2):
artemis.run --offline: actual-main args
actual-main args:
certificate-roots.install-common-trusted-roots
adapter := ble.Adapter
central := adapter.central
data := {}
central.scan --duration=SCAN-DURATION: | device/ble.RemoteScannedDevice |
data.add device.data.manufacturer-data
ble.ble-close_ adapter.resource_group_
network := net.open
client := http.Client network
headers := http.Headers
if args[1] == null or args[1] == "":
throw "Authorization header is required"
exit 1
headers.add "Authorization" args[1]
headers.add "Device-ID" artemis.device.id.to-string
try:
session := client.web-socket --uri=args[0] --headers=headers // ws://192.168.0.58:8080/ws
data.do:
session.send (hex.encode it)
finally:
session.close
finally:
network.close
close
artemis.run --offline
with-timeout
[artemis.synchronize] INFO: firmware update initiated
[artemis.synchronize] INFO: firmware update {from: <base64>, to: <base64>}
[artemis.synchronize] INFO: synchronized state to broker
[artemis.scheduler] INFO: runlevel decreasing {runlevel: 1}
[artemis.synchronize] INFO: firmware update {size: 1719648}
E (11105) Toit: Oversized ota_begin args: 1719648-1703936
[artemis.scheduler] INFO: runlevel increasing {runlevel: 3}
[artemis.synchronize] WARN: firmware update failed {error: OUT_OF_BOUNDS}
envelope: esp32-ota-1c0000
envelope: esp32-ota-1c0000
Firmware is too big to fit in designated partition (1719648 > 1703936)
EXCEPTION error.
firmware tool failed with exit code 0
envelope: esp32-ota-1c0000
artemis serial flash
firmware-envelope
envelope
envelope
envelope
Broker error: duplicate key value violates unique constraint "pods_pkey"
pods
./artemis pod upload --tag=v1.0.3r1 tracker.pod
artemis pod tag
artemis.run --offline
--timeout
with-timeout