https://toitlang.org/ logo
Reducing application size
# help
b
Hey. I discovered that, while my containers with artemis can be flashed to esp32s3, the application size is too large for esp32c3. Somehow the pod is larger when building for that target. Anyways, I removed the
logging
library from my application and that did the trick for now. This may be a bit of a noob question, but do you have any tips for understanding which packages/libraries/etc are larger and consuming space? I read https://medium.com/the-toit-take/get-insight-into-memory-use-on-your-esp32-running-toit-65c62e5b65fd but I'm not sure if/how this applies to packages/libraries my application. Would really appreciate some general advice here
I am trying to use stuff like this, but running into errors
Copy code
sh
āžœ  toit git:(main) āœ— toit analyze main.toit
EXCEPTION error. 
Error trying to run '/usr/local/lib/toit/bin/toit.compile': No such file or directory
k
How did you install
toit
? Or did you build it yourself?
b
I downloaded the macos binary
k
Oh. Interesting. Thanks!
Did you download the tar-ball? We typically look for the
toit.compile
relative to where
bin/toit
is installed.
f
I recently changed the location of the lib directory. So maybe it isn't working correctly for macos. For macos there are 4 ways to install it: - build yourself - use homebrew - use the release dmg - use the release tar.gz @bpmct from your reply I'm guessing it was either the DMG or tar.gz. Correct?
For the application size: envelopes + applications are bundled together into a binary image which is then flashed into the
ota
partitions.
It has nothing to do with the memory.
That's generally good news, because it's usually easier to find flash-space, compared to RAM.
The first question is: what partition layout do you use?
In your pod-specification file you should have a line for the partitions.
I think Artemis uses
OTA-1C0000
by default.
That said: older versions of Artemis didn't do that, which led to relatively small partitions, making it really hard to install programs.
k
I just tried the
tar.gz
variant on my Mac and there we find the
toit.compile
helper in the correct location.