For static code analysis, here's a list of tools:
http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis[
^]
However, it may be that there is nothing wrong with your memory management per se - maybe it is just that your program isn't well designed and really uses that much memory. Since you obviously have a database application, the prime reason should be obvious: holding data from your database in memory! You should check all functions that read data and make sure they don't hold onto that data for longer than necessary. Maybe you can also find ways to reduce the required amount of memory.
Another potential problem is SQL joins: If you don't pay attention on how you read data from joined tables, then the amount of memory required to process a join of multiple tables can easily explode! Example: "Select * from persons, addresses, cars, insurances, bankaccounts where ..." even if the filter reduces the set of records to just a few, if each of the five involved has only 100 records, then the initial select joining 5 tables creates a virtual table with 10 billion records! You should strive to avoid that by using sub select statements that join tables one on one. Of course, that is highly hypothetical: a good database engine may recognize that and optimize accordingly - but depending on how exactly your sql statements look, you may need to optimize them manually.