|We don't bite newbies here... much|
Memory usage of array and hashe variables by multiple inclusion.by tobias_hofer (Friar)
|on Jul 02, 2013 at 10:42 UTC||Need Help??|
tobias_hofer has asked for the
wisdom of the Perl Monks concerning the following question:
I am facing an increasing memory usage over the time (during the application-run) and i am not shure what could be the root-cause.
Ok.. I got here a test-system written in perl (not by me) which is loading test-code (also written in perl)more or less dynamically like this:
The test-system itself and the test-code are using the same modules for accessing global variables.
However, some of those modules have some globals which will be accessed/filled during the test run - in example:
Now the badest. Some of these modules include each other, and modules are loaded several times.
Can modules be loaded several times?
Now my wild guess, in case modules can be loaded several times the global vars stay as they are but during the "use" the local vars and objects are created each time the module is loaded. Thus the memory increases - I guess ?
Am I right or completely wrong?
Is there in perl something like the include-protection in C ?