oop - Solve out of memory error using Static Program Analysis -


out of memory 1 of frequent errors in java , other oo languages. can apply static program analysis reduce "out of memory" errors ? looking approaches aims reduce error without running code. there particular areas of analysis perform research in ?

yes, static analyzers able detect out of bounds. worse dynamic analyzers, cannot trace complex cases of pointer usage. moreover, static analyzers cannot obtain information. let’s consider abstract situation:

void outstandingissue(const char *strcount) {   unsigned ncount;   sscanf_s(strcount, "%u", &ncount);    int array[10];   memset(array, 0, ncount * sizeof(int)); } 

whether array index out of bounds happens or not, depend on data received outside. static code analyzer powerless here. maximum of can here warn entered value used without check. dynamic analyzer detect error during testing program, while receive various variants of input data. these topics given here more details.

but if there question “does static analyzer help?”, answer yes, does. example, collection of bugs gathered pvs-studio team contains number of type errors detected static analyzer: v512, v645.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -