Skip to content

Memory and session disposal, best practices #4925

Closed

Description

@itg-assistant

Jorge Bastos asked 2025-12-21 17:18:35 UTC

Hi there,

Whats the best way to be sure that memory is disposed in browser/tab closes?
My IIS crashes due to high memory usage.

Should these two parameters in web.config be enoutgh for the job?

<system.web>

</system.web>

Activity

  1. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    JD answered 2025-12-21 17:34:34 UTC

    sessionstate is not a Wisej option. It’s Asp.net. The session timeout in wisej is an option in default.json - refer to extensive online documentation.

    If you have a memory leak in your code use the memory profiler to find out which root in your code is holding references.

    You don’t need to change anything related to the GC. It’s all handled automatically by .NET. Wisej doesn’t have anything to do with memory management and there is nothing for you to change other than avoiding memory leaks.

    Memory leaks in .NET occur when you have a root (see .NET documentation about roots and garbage collection) that holds on a reference. It’s all standard .NET stuff - it’s not and cannot be changed by wisej or any other framework.

  2. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Jorge Bastos answered 2025-12-21 17:45:37 UTC

    hum ok,
    but that config, will lead me to the wisej form with the session timeout, and i don’t want that to appear, i have two situations:

    1,
    – app has a login interface, and i don’t want users to be all the time extending the timeout

    2,
    – app has a dashboard that run’s by itself, i don’t want that form to appear ontop of the dashboard

    is where a way for the wisej timeout take effect only when the browser closes or something like that?

  3. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    JD answered 2025-12-21 17:49:45 UTC

    That unrelated to your memory leak. There is a whole section in the docs explaining session management and exactly your situation.

  4. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Gabriele Del Giovine answered 2025-12-21 17:54:35 UTC

    You can manage the Application SessionTimeout Event....

  5. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Jorge Bastos answered 2025-12-21 17:56:01 UTC

    its related, because i have some users that open the dash every 20 secs

  6. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Jorge Bastos answered 2025-12-21 18:00:17 UTC

    ya, i’m reading the doc that JD suggested, going to do it with care, thanks both, if i need anything else i’ll post :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions