guild icon
Toit
#Heap usage
Thread channel in help
tplux
tplux 03/29/2023 12:20 PM
Hi!
I am currently printing the heap report when free memory is below 10k or above 50k to see where the memory is used. As you can see, the big difference between the 2 screenshots is "process 0x3ffd1018", which pretty much accounts for the 40k. Is there any way of knowing more about what that process is doing?
erikcorry_arbat
erikcorry_arbat 03/29/2023 12:38 PM
There's one system process and then there's your own.
I guess you are not running Jaguar on this.
erikcorry_arbat
erikcorry_arbat 03/29/2023 12:39 PM
In your own program you can run
print_objects "myprog" --gc
To get a report for the current process.
erikcorry_arbat
erikcorry_arbat 03/29/2023 12:41 PM
This device has PSRAM?
tplux
tplux 03/29/2023 12:47 PM
No PSRAM. I'll try the myprog thing :๐Ÿ™‚:
erikcorry_arbat
erikcorry_arbat 03/30/2023 08:09 AM
Without PSRAM I would expect the heap metadata to be half the size. Which version is this?
tplux
tplux 03/30/2023 08:37 AM
This is with version 69.
erikcorry_arbat
erikcorry_arbat 03/30/2023 08:45 AM
OK that's new enough.
erikcorry_arbaterikcorry_arbat
Without PSRAM I would expect the heap metadata to be half the size. Which version is this?
tplux
tplux 03/30/2023 09:42 AM
Should I worry about this? :๐Ÿ˜…:
erikcorry_arbat
erikcorry_arbat 03/30/2023 09:43 AM
I'm going to tune the heuristics so you use 12k less of Metadata.
๐Ÿ‘1
erikcorry_arbat
erikcorry_arbat 03/30/2023 11:10 AM
https://github.com/toitlang/toit/pull/1531 is the change, which should give you 12k.
The metadata size adjusts on a sliding scale
according to the size of malloc-able memory.
tplux
tplux 03/30/2023 11:12 AM
Thanks. Will try it out :๐Ÿ‘:
12 messages in total