Skip to content

Apple2 memleak analysis notes.

Thomas Cherryhomes edited this page May 10, 2024 · 8 revisions

Goal

Fix memory leak when using HTTP protocol adapter with JSON channel mode.

Changes to keys.cpp

key action
A SINGLE TAP Heap
A DOUBLE TAP Tasks

Available memory after cold start

15:07:05.542 > Heap: 36492

This is very low.

Initial boot log 2024-05-10

15:19:48.294 > --~--~--~--
15:19:48.294 > FujiNet v1.3 2024-04-26 06:08:28 Started @ 7
15:19:48.294 > Starting heap: 4358276
15:19:48.295 > [src/main.cpp:162] main_setup(): Heap: 212971
15:19:48.297 > 
15:19:48.316 > Rev1 Hardware Defined
15:19:48.316 > FujiApple NO3STATE & SPIFIX ENABLED
15:19:48.316 > FujiApple SPI fix ENABLED
15:19:48.318 > Detected Hardware Version: 1.6.1 and up
15:19:48.318 > Safe Reset button ENABLED on GPIO 4
15:19:48.478 > SPIFFS mounted.
15:19:48.552 > SD mounted.
15:19:48.552 > fnConfig::load
15:19:48.552 > Load fnconfig.ini from SD
15:19:48.552 > fopen = /fnconfig.ini : ok
15:19:48.556 > fnConfig::load read 1097 bytes from config file
15:19:48.556 > Reading wifi section
15:19:48.559 > Reading stored wifi section for index: 0
15:19:48.600 > FLASH Config Storage: Enabled
15:19:48.601 > fnConfig::load read 1097 bytes from FLASH config file
15:19:48.602 > FNJSON::ctor()
15:19:48.602 > iwmNetwork::iwmNetwork()
15:19:48.602 > 
15:19:48.603 > Config General Boot Mode: 0
15:19:48.603 > FileSystemSPIFFS::filehandler_open /autorun.po rb
15:19:48.673 > new FileHandlerLocal
15:19:48.673 > disk MOUNT /autorun.po
15:19:48.673 > 
15:19:48.673 > Media Type POFileHandlerLocal::read
15:19:48.674 > 
15:19:48.674 > IWM FujiNet based on SmartportSD v1.15
15:19:48.674 > 
15:19:48.675 > FujiNet Hardware timer started
15:19:48.675 > RMT configured for Disk ][ Output
15:19:48.677 > SPI configured for smartport I/O
15:19:48.677 > IWM GPIO configuredAvailable heap: 4228500
15:19:48.679 > Setup complete @ 392 (385ms)
15:19:48.679 > [src/main.cpp:463] main_setup(): Low Heap: 135775
15:19:48.682 > 
15:19:48.701 > WiFiManager::start() complete
15:19:48.798 > WiFiManager attempting to connect:
15:19:48.798 > ssid = Cherryhomes
15:19:48.798 > WiFi connect attempt to SSID "Cherryhomes"
15:19:48.800 > WIFI_EVENT_STA_START
15:19:48.800 > esp_wifi_connect returned 0
15:19:50.742 > WIFI_EVENT_STA_CONNECTED
15:19:52.733 > IP_EVENT_STA_GOT_IP
15:19:52.733 > Obtained IP address: 192.168.1.19
15:19:52.733 > SNTP client start
15:19:52.736 > Starting web server on port 80
15:20:26.242 > SNTP time sync event: Fri May 10, 15:20:26 2024 -0500
15:20:44.425 > BUTTON_A: SHORT PRESS
15:20:44.725 > Heap: 36468

Clone this wiki locally