Diff on 1gb files

Hey Guys,
I have a scenario to compare two different files which are of size 1gb each. I need to get the uncommon lines. I planned to use sdiff command, which generally works perfect for me. But in this case am facing a error saying

"diff: memory exhausted"
Can anyone please explain this.

Also, can anyone suggest a unix command to compare huge files, to get the common and the uncommon lines between the two files.

Thanks,
Abhishek S.

try:

cmp file1 file2

Use the command