+ // Search the current pid in the list of processes
+ while (stat->pid != getpid() && i < entries)
+ {
+ ++i;
+ ++stat;
+ }
+
+ // Display total memory size
+ double mem = stat->proc_resident/1000/1000; // in MB
+ return mem;
+#else
+ return 0.0;
+#endif
+ }