Stripping unused commands from libries storage space /dynamiac memory

I'm using a MP3 shield and the shield needs to have more free RAM. So, even though my program fits with about 500 free RAM... that's about half of what I need to play songs.

I've worked hard to optimize my code and get rid of globals.

Is the next step integrating libraries so that I can streamline them? Could I just copy the files into my sketch folder then edit them?

I still use the libraries for other sketches so, will this ruin them?

I'm also thinking of getting a mega. The extra serial ports would let me avoid software serial and of course it has more memory.

But, it's so big... and has too many pins. Is there a "mini mega" LOL.

Thanks!

futurebird:
I'm using a MP3 shield and the shield needs to have more free RAM. So, even though my program fits with about 500 free RAM... that's about half of what I need to play songs.

I've worked hard to optimize my code and get rid of globals.

Is the next step integrating libraries so that I can streamline them? Could I just copy the files into my sketch folder then edit them?

I still use the libraries for other sketches so, will this ruin them?

I'm also thinking of getting a mega. The extra serial ports would let me avoid software serial and of course it has more memory.

But, it's so big... and has too many pins. Is there a "mini mega" LOL.

Thanks!

Yes, there is the "Meduino", a.k.a. "Mega 2560 Pro Mini".

Regards the libraries, you should rename them and keep the originals intact for your other programs. Bringing them into your programs is an ugly way to do it.

Post your code!

Mark

No, the compiler only compiles just the parts of the library that you're actually using.

As a test once, I wrote my own version of strncpy(), which is one of the functions in the large <strings.h> library. The size of the compiled program was different by 1 byte.

A Teensy has much more memory than a Mega, 3 serial ports, faster clock speed and it's almost the smallest Arduino board out there.