The compiler/linker will remove unused functions/methods automatically, so I doubt you can save memory by removing unused functions/methods yourself.
However, you could possibly gain by:
- Removing the calls of check functions/methods when you know the result will be always
false,true, or always the same number, string or data type in general. - Removing (parts of) functions/methods which are related to physical or logical functionality you never use. Like e.g.
if,casestatements that will never apply). - Prevent using an entire class (e.g.
String) (see second comment of Emma Makes below).