NAS restart when use CLEARALL in CAL code

sunmorningindiasunmorningindia Member Posts: 65
Hi,

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?

NAV 5 SP1

Comments

  • vaprogvaprog Member Posts: 1,139
    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?
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    CLEARALL does not affect or change values for variables in single instance codeunits.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • vaprogvaprog Member Posts: 1,139
    Hi einsTeIn.NET

    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.
  • DenSterDenSter Member Posts: 8,305
    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.
  • sunmorningindiasunmorningindia Member Posts: 65
    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.
  • DenSterDenSter Member Posts: 8,305
    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?
  • ara3nara3n Member Posts: 9,256
    my guess he is using an automation and he is not clearing them in correct sequence.

    If you don't clear them in correct sequence, you can get NAS crashed.

    CLEARALL probably is the problem in that case.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • sunmorningindiasunmorningindia Member Posts: 65
    Solved
Sign In or Register to comment.