If Eclipse itself is running out of memory, you just need to change the startup arguments used in your shortcut to start eclipse to something like:
eclipse.exe -vmargs -Xms128M -Xmx512M
If a standalone program you’re debugging is running out of memory then modify the launch configuration to add the -X arguments above when it is launched.
If you’re running an application server through one of our connectors, add the arguments (one per line) to Window > MyEclipse > Application Servers > <server-name> > JDK