c++ - Hypothetical Memory Usage Monitoring Program -


would @ possible (i don't care practicality or usefulness) write c or c++ program monitored memory usage in following, basic way?


given declaring variable without assigning value results in having value of whatever @ memory location, 1 create large array (thousands or millions of elements) , leave values unassigned. see if of these elements have been overwritten, need repeatedly compare current values previous value.


i highly doubt simple posited above. assuming doubt well-founded, wherein problem lie and, more importantly, circumvent creative or esoteric code? imagine problem attributable along lines of declared, uninitialized elements being not allowing other system processes write memory address. please give me pointers! (heehee) thanks.

lets program in c creating large array limited extent free memory allowed , how os limits you.

so let's created pretty large array (uninitialized). memory given process(program ran) , no other process can access ! (it's os role avoid such things , basic requirements of virtualization).

so no other process can access value won't changed once allocated you.


Comments