CLIPS counts the number and amount of each memory request that it makes from the operating system and updates those values each time memory is returned to the operating system. When an environment is destroyed all outstanding memory allocations are returned to the operating system and the counts are checked. If the numbers aren't zero then there's an error in the math somewhere. In this case it could be something as simple as one of the routines deallocating a string not including the end of string marker in the count. That doesn't mean there's an actual memory leak since the C allocation libraries require you to specify the size when allocating but not deallocating.
You can simply comment out the code that generates this message, but the safer solution is to create a reproducible example that can be used to determine what's going on in the CLIPS code that's not bringing both counts back to 0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems that the problem comes from the call to "get-region" when the region is an integer.
the following java code :
final Environment clips = new Environment();
clips.load("fetch.clp");
clips.run();
clips.clear();
clips.destroy();
With the attached "fetch.clp" and "region.lis" give the memory error There is no problem with print-region or if the region is a regular string (not an integer).
Hi,
I sometimes get the following warning/error message when I "destroy" a Java "Environment" :
[ENVRNMNT8] Environment data not fully deallocated.
[ENVRNMNT8] MemoryAmount = 1.
[ENVRNMNT8] MemoryCalls = 0.
what does this exactly mean and how can I avoid this ?
CLIPS counts the number and amount of each memory request that it makes from the operating system and updates those values each time memory is returned to the operating system. When an environment is destroyed all outstanding memory allocations are returned to the operating system and the counts are checked. If the numbers aren't zero then there's an error in the math somewhere. In this case it could be something as simple as one of the routines deallocating a string not including the end of string marker in the count. That doesn't mean there's an actual memory leak since the C allocation libraries require you to specify the size when allocating but not deallocating.
You can simply comment out the code that generates this message, but the safer solution is to create a reproducible example that can be used to determine what's going on in the CLIPS code that's not bringing both counts back to 0.
Thanks,
I will pay attention to this problem next time I see it.
Hi,
It seems that the problem comes from the call to "get-region" when the region is an integer.
the following java code :
With the attached "fetch.clp" and "region.lis" give the memory error There is no problem with print-region or if the region is a regular string (not an integer).
Last edit: Chaubert Jérôme 2016-12-08
I checked a fix into the 63x code branch, https://sourceforge.net/p/clipsrules/code/HEAD/tree/branches/63x/core/. It's also attached. There was no actual memory leak, the memory tracking count was just off. Let me know if this does not resolve your issue.
Th e fix works fine many thanks