Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:58:07+00:00 2026-06-10T10:58:07+00:00

Here is my situation. I am building a small Windows Form that will launch

  • 0

Here is my situation. I am building a small Windows Form that will launch on Startup and run minimized in the System tray while not in use. The user will open the Form via a Notify Icon in the System tray and after submitting the form, the app will minimize back down to the System tray.

This all works fine. However, I noticed something a little odd. When the program is first launched, the Mem Usage in Task Manager shows ~14000 K. If I then open the Form from the system tray, it kicks up to ~16000 K. If I then minimize the form back down to the system tray, the usage drops to < 1000 K which is good. I have tried launching the application and waiting to see if the Usage dropped over time, but saw no change.

The reason I am concerned about this is because the application will be running in a Citrix Environment, so I would like to keep the Memory usage per instance down when the application is not in use, but I would prefer to not have to have the user open the application and minimize it every morning when they login.

If anyone has any suggestions or tips, I would greatly appreciate it. I will include the main blocks of code below.

public Form1()
{
    InitializeComponent();
    WindowState = FormWindowState.Minimized;
    notifyIcon1.DoubleClick += new EventHandler(notifyIcon1_DoubleClick);
    Rectangle r = Screen.PrimaryScreen.WorkingArea;
    this.StartPosition = FormStartPosition.Manual;
    this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
    currentWorkstation = Environment.GetEnvironmentVariable("clientname");
    if (currentWorkstation == null)
        currentWorkstation = Environment.MachineName;
    GC.KeepAlive(notifyIcon1);
    GC.KeepAlive(currentWorkstation);
}

private void Form1_Resize(object sender, EventArgs e)
{
    if (WindowState == FormWindowState.Minimized)
       Hide();
}

Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:58:08+00:00Added an answer on June 10, 2026 at 10:58 am

    The fake “drop” in memory is because during a minimize event, Windows transfers the majority of application memory to virtual memory. During your startup, you’re probably never actually closing a form/minimizing the application, therefore the cleanup never occurs.

    More information can be seen here:

    https://micksmix.wordpress.com/2010/01/08/why-does-task-manager-show-an-applications-memory-usage-drop-after-minimizing-it-to-the-the-taskbar/

    My knowledge of this only comes from using this as a way to trick the J++ GC into running. Telling a windows application to minimize/restore is nearly imperceptible to the user, but minimizes RAM accrual in a managed-memory VM. I highly doubt this is “best practices” but it makes the numbers-guys in management happy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To clarify, here's the situation: I'm building a really simple CMS that will become
Here's the situation I have: I'm building an online system to be used by
Here's my situation: I'm building a small website where, when registring, you can select
Here is my situation. I am building an application that contains some heavy mathematical
I have an situation here that looks very like a SELECT N+1 from the
I have a simple situation here. lets face html code first => <form name=geoKey
Here is my situation. I need to create a report that shows each open
I have a small situaton here. I'm building a custom CMS for one of
I have an interesting situation here. I am building a board game and I
We're building a web app that customers can pay a monthly rate for. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.