I was trying to load 51 MB of data on weka, while trying to load data I was getting heap size error, I did the simple trick by changing the
MEMORY="456m"
in the file /usr/bin/weka which was 256 M previously.
Now it works!!