Large stack memory usage #1

Open
opened 2021-01-18 13:36:53 +08:00 by harry · 0 comments

(Cloned from https://github.com/smoltcp-rs/ENC424J600/issues/4. Authored by @occheung .)


Description

With a large MTU / RAW_FRAME_LENGTH_MAX at 0x1000, large amount stack space is consumed. Seems that large arrays are allocated onto the stack on transmitting/receiving packets.
On transmitting case, these few lines of code may have contributed to this issue.
010be3e9eb/src/tx.rs (L54-L60)
010be3e9eb/src/lib.rs (L161-L163)

Shrinking RAW_FRAME_LENGTH_MAX to 1500 have improved this significantly in my case.
Is it worth looking into reusing large arrays? Or even allow static buffers to be supplied by user?

(Cloned from https://github.com/smoltcp-rs/ENC424J600/issues/4. Authored by @occheung .) --- ## Description With a large MTU / `RAW_FRAME_LENGTH_MAX` at `0x1000`, large amount stack space is consumed. Seems that large arrays are allocated onto the stack on transmitting/receiving packets. On transmitting case, these few lines of code may have contributed to this issue. https://git.m-labs.hk/M-Labs/ENC424J600/src/commit/010be3e9eb9eedaf1aec4345910244a07a040ade/src/tx.rs#L54-L60 https://git.m-labs.hk/M-Labs/ENC424J600/src/commit/010be3e9eb9eedaf1aec4345910244a07a040ade/src/lib.rs#L161-L163 Shrinking `RAW_FRAME_LENGTH_MAX` to 1500 have improved this significantly in my case. Is it worth looking into reusing large arrays? Or even allow static buffers to be supplied by user?
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: renet/ENC424J600#1
There is no content yet.