Gnuplot does not do anything special with memory management.
It uses the malloc() routine provided by the system libc.
On linux systems you can tune the behaviour of the system routine in
several ways, none of which require rebuilding or relinking the gnuplot
executable.
See "man malloc".
Just out of curiousity, what output terminal type are you using?
Is it possible that the problem is in displaying the plot rather
than in generating it?
Ethan