Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Conversation

salasidis
Copy link
Contributor

Example of Destructive C string Send, using global declaration (or commented out malloc in heap) string.

Does not use SDRAM.

@khoih-prog
Copy link
Owner

Hi @salasidis

You're a step behind, sorry. I already update the examples.

Please check and test

  1. Async_AdvancedWebServer_MemoryIssues_Send_CString where we can use #define to select either SDRAM or not, etc.
  2. Async_AdvancedWebServer_MemoryIssues_SendArduinoString

Terminal Debug

Async_AdvancedWebServer_MemoryIssues_Send_CString ===> Using SDRAM, very small heap (12847)

Using SDRAM
Start Async_AdvancedWebServer_MemoryIssues_Send_CString using SDRAM on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncTCP v1.4.0
Portenta_H7_AsyncWebServer v1.4.0
Using mac index = 2
Connected! IP address: 192.168.2.123
HTTP EthernetWebServer is @ IP : 192.168.2.123

HEAP DATA - Pre Create Arduino String  Cur heap: 8458  Res Size: 451648  Max heap: 8472
.
HEAP DATA - Pre Send  Cur heap: 9634  Res Size: 451648  Max heap: 10196

HEAP DATA - Post Send  Cur heap: 9734  Res Size: 451648  Max heap: 12847
......... .......... .......... .......... .......... .......... .......... ..........
Out String Length=31200
.......... .......... .......... .......... .......... .......... .......... ..........
Out String Length=31219
.......... .......... .......... .......... .......... .......... .......... ..........
Out String Length=31255
.......... .......... .......... .......... .......... .......... .......... ..........
Out String Length=31198
.......... .......... .......... .......... .......... .......... .......... ........
HEAP DATA - Post Send  Cur heap: 11201  Res Size: 451648  Max heap: 14314
..
Out String Length=31224
.......... .......... .......... .......... .......... .......... .......... ..........
Out String Length=31235
Not using SDRAM ===> small heap (51823)
Start Async_AdvancedWebServer_MemoryIssues_Send_CString on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncTCP v1.4.0
Portenta_H7_AsyncWebServer v1.4.0
Using mac index = 8
Connected! IP address: 192.168.2.123
HTTP EthernetWebServer is @ IP : 192.168.2.123

HEAP DATA - Pre Create Arduino String  Cur heap: 47434  Res Size: 451760  Max heap: 47448
.
HEAP DATA - Pre Send  Cur heap: 48610  Res Size: 451760  Max heap: 49172

HEAP DATA - Post Send  Cur heap: 48710  Res Size: 451760  Max heap: 51823
......... .......... .......... .......... .......... .......... .......... ..........
Out String Length=31200
.......... .......... .......... .......... .......... .......... .......... ..........
Out String Length=31291

===================================================================

Async_AdvancedWebServer_MemoryIssues_SendArduinoString ===> very large heap (111387)

Start Async_AdvancedWebServer_MemoryIssues_SendArduinoString on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncTCP v1.4.0
Portenta_H7_AsyncWebServer v1.3.0
Using mac index = 0
Connected! IP address: 192.168.2.123
HTTP EthernetWebServer is @ IP : 192.168.2.123

HEAP DATA - Pre Create Arduino String  Cur heap: 7434  Res Size: 452016  Max heap: 7448
.
HEAP DATA - Pre Send  Cur heap: 48611  Res Size: 452016  Max heap: 48611

HEAP DATA - Post Send  Cur heap: 79009  Res Size: 452016  Max heap: 111347
.
HEAP DATA - Post Send  Cur heap: 79029  Res Size: 452016  Max heap: 111387
...
HEAP DATA - Post Send  Cur heap: 79037  Res Size: 452016  Max heap: 111403
....
HEAP DATA - Post Send  Cur heap: 79041  Res Size: 452016  Max heap: 111411
. ..
Out String Length=31247
.......
HEAP DATA - Post Send  Cur heap: 79047  Res Size: 452016  Max heap: 111423
. ....
Out String Length=31233
...... ......
Out String Length=31243
.... .......
Out String Length=31251
... .......
HEAP DATA - Post Send  Cur heap: 79054  Res Size: 452016  Max heap: 111437
..
Out String Length=31280
. ......

@salasidis
Copy link
Contributor Author

Excellent.

@khoih-prog
Copy link
Owner

Closed as completed via #8

@khoih-prog khoih-prog closed this Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants