Maybe a question of what packages you have installed.
I managed to hit 450 MB, but for that I had to rebuild Lazarus itself (which is a large project), including smart linking and full debug info (which both add to mem usage).
Of course that is without debugging. Debugging will need some memory.
I have not tested any of the below. They may save nothing, or just a very few bytes. They may save more.
If you look at our sourceforge page, in each of the Windows sections (32/64) there is an "Alternative GDB" folder. The newer gdb are often faster. I have not compared them for memory usage.
But whether you use 2.x or 1.6, you may want to download them, and compare them.
You also may want to set "Reset debugger after each run" in Tools > Options > Debugger. That may release some memory.
Try "stabs" vs "dwarf with sets" (on 64 bit, it is always dwarf, stabs does not work / on 32bit you can choose)
dwarf gives the better results. But I do not know which uses more mem.
If you do, ensure you change it for packages too. They have there own options. (Search "Additions and overrides" on the wiki)
Better yet, if you do not step into packages (like lcl) during debug, then consider turning off debug info for those packages. That should save some mem. (debugging and compiling)
To do that, open each package, go to its options, disable debugging, and under "custom options" remove $(IDEBuildOptions)
You can save some more mem (1.6 and 2.x) with regards to debugging
- Turn off the debug history. The window (view > debug windows > history) has a power button.
Unfortunately it does not stick.
Edit lazarus\debugger\historydlg.pp and change the state of the power button in the object inspector.
And edit lazarus\debugger\debugger.pp around line 2765
constructor TSnapshotManager.Create;
FActive := True; // change to false
I think that should stop it.
- If you eval a big lot of watches, the debugger keeps some cache. Disabling it may slow down the debugger, but can save some mem.
lazarus\components\lazdebuggergdbmi\gdbmidebugger.pp
Around line 11550 comment out this line:
FTheDebugger.FTypeRequestCache.Add(ContextThreadId, ContextStackFrame, AReq^);
You may have to search for the lines. The numbers are svn trunk. But you should be able to find the code, even in 1.6. It may be a few 100 lines above or below.
If you do test 2.0.x again. Try fpdebug.
I have not tested it for mem usage. But it does not need gdb at all. Of course it will need more mem in the IDE. Not sure if the grant total is better.
Note that FpDebug only works with "dwarf" (dwarf with sets).
Also fpdebug is still beta. It still has some small hiccups. But on windows it should be use-able.
If your apps have large structures (big arrays, etc), in 2.0 you can set various memory limits for gdb (beyond those, gdb will not eval any watch)
In 2.0, there are some new Highlights for the editor (such as begin end blocks having a vertical colored line).
Turn them off, and restart the IDE.
Tools > Option > Editor > Markup and Matches
Turn off "Outline (global)
In 1.6 and 2.0
You also may turn off "Keyword brackets", or deselect some of the keywords you do not need.
You may want to turn off folding ... > Editor > Code Folding
Or turn off all highlight completely (Icon on the "colors" page).
Turn off "Highlight occurrences off word under caret"
And ... > Editor > General > Miscellaneous : Turn off "trim spaces"
Not sure how much that will save....
As I said try it
Delete (backup) the folder (will affect code completion/navigation // compilation will still work)
lazarus\fpc\3.0.4\source\packages
and do menu Tools > Rescan fpc directory
restart IDE
Play with using / not using "smart linking"
Smart linking needs a ton of memory to link your exe.
Though without it the resulting exe will be bigger. (and more data for the debugger)