Comment out malloc_trim(). This functions gives back memory to the system via negative calls to sbrk(). This is completely useless in U-Boot since noone else could make use of this memory.