I changed the draw_text line from

Code:
draw_text(str_printf(NULL, "freemem: %d",mem),10,10,COLOR_RED);



to

Code:
draw_text(str_printf(NULL, "freemem: %u",mem),10,10,COLOR_RED);



The value I see now could be the right one ... I will check it out a little further.