Re: Increased RAM usage after upgrade to newlib 4.3.0
"Pavel V. Melnikov" <[email protected]> Mon, 2 Feb 2026 10:18:55 +0100
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <CAJMnEww5RqinHazqEcw6V=Q3fq=Uk0vHAjSgBc=fVpBGh2wovQ@mail.gmail.com> |
Hello Sebastian! Thank you for your suggestions! It seems they all require recompilation of newlib with different flags. I'd like to avoid that and use manufacturer-supplied packages, to keep the project structure easily reusable by other people with various levels of expertise. I think even switching to a non-newlibc might cause adoption problems, but I'll try to investigate there. It would be nice though if the behaviour from newlib 4.2 were brought back, i.e. small stub FDs are stored by default, and re-initialized to full FDs when needed. Maybe this can be tied to linking against libnosys as this is then configurable without recompilation. ___________________________________ Best wishes, Paul Melnikov On Thu, 22 Jan 2026 at 13:35, Sebastian Huber <[email protected]> wrote: > > Hello Pavel, > > if you would like to reduce the memory footprint, then you can try out piclolibc as mentioned. You can also try using thread-local storage for the libc thread-specific data through the _REENT_THREAD_LOCAL option. Another option is to change the struct reent initialization for the _REENT_SMALL initialization to dynamically check if the stdio file streams are NULL before they are used. If they are NULL, then they are initialized to use the global __sf[] objects. > > Kind regards, > Sebastian > > -- > embedded brains GmbH & Co. KG > Herr Sebastian HUBER > Dornierstr. 4 > 82178 Puchheim > Germany > email: [email protected] > phone: +49-89-18 94 741 - 16 > fax: +49-89-18 94 741 - 08 > > Registergericht: Amtsgericht München > Registernummer: HRB 157899 > Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler > Unsere Datenschutzerklärung finden Sie hier: > https://embedded-brains.de/datenschutzerklaerung/