Currently I am facing problem of high CPU utilization on NAS server, so I use CLEARALL in my CAL code on Test Server. And I found, the NAS restart after each request.
Is CLEARALL function prohibited to use in NAS environment?
Is there an event in that codeunit NAS is wating for? If yes, then if you clear the automation object, how should the codeunit get triggered ever again unless it is initialised anew?
you are right, unfortunately. I did not think about the fact that the codeunit called from NAV which installs an activation event needs to be single instance.
But furthermore, although I knew that statement in help about CLEARALL, it seems rather unclear to me concerning wether this applies when CLEARALL is called from within a single instance codeunit or it only appies to single instance codunits refered to by variables in any object from which CLEARALL is called.
The former, in my oppinion, makes little sense. However, that is how it is implemented.
If you know that CLEARALL causes a problem in a single instance codeunit, and you are working in a single instance codeunit, then why did you implement it that way anyway? You will need to find another way to clear the variables.
I am trying to find out a way to fix this memory leak.
In my senario the NAS goes high all the time, it doesn’t release memory.
It seems to be a memory leak either in my Automation related code or in NAS.
I guess I am confused.... You start by saying you have a high CPU 'problem' and now you have a memory leak. How did you determine whether you have indeed a memory leak? Do you have some sort of diagnostic tool that determines that memory has been leaked?
Comments
you are right, unfortunately. I did not think about the fact that the codeunit called from NAV which installs an activation event needs to be single instance.
But furthermore, although I knew that statement in help about CLEARALL, it seems rather unclear to me concerning wether this applies when CLEARALL is called from within a single instance codeunit or it only appies to single instance codunits refered to by variables in any object from which CLEARALL is called.
The former, in my oppinion, makes little sense. However, that is how it is implemented.
RIS Plus, LLC
In my senario the NAS goes high all the time, it doesn’t release memory.
It seems to be a memory leak either in my Automation related code or in NAS.
RIS Plus, LLC
If you don't clear them in correct sequence, you can get NAS crashed.
CLEARALL probably is the problem in that case.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n