Index: trunk/psLib/src/sys/psMemory.c
===================================================================
--- trunk/psLib/src/sys/psMemory.c	(revision 28401)
+++ trunk/psLib/src/sys/psMemory.c	(revision 30595)
@@ -626,5 +626,6 @@
             nleak++;
 
-            if (fd != NULL) {
+	    // only print a max of 500 leaks (make this an argument)
+            if ((nleak < 500) && (fd != NULL)) {
                 if (nleak == 1) {
                     fprintf(fd, "# func at (file:line)  ID: X  Ref: X\n");
