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

  • SEARCH
  • Home
  • 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 5992323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:30:54+00:00 2026-05-22T23:30:54+00:00

I create a lot of simple programs, which don’t need any memory, but they

  • 0

I create a lot of simple programs, which don’t need any memory, but they always show around 1MB-1.6MB memory in the private memory column in task manager.

I read that the default stack size is 1MB for linking with link.exe, i tried playing with /STACK like this :

/STACK:65536 (64kb)
/STACK:16777216 (16mb)

when i run the program, the memory hasn’t changed at all..

Even a simple program like this, using 1.6MB compiled as 64bit with link.exe and no libs (simple.c):

#include <stdio.h>

int main() {
  puts("hello world\n");
  getchar();
  return 0;
}

Can anyone tell me how i can reduce the memory on simple programs? i know 1mb isn’t much but i’m very curious as there are some windows processes which show very low memory in taskman, e.g. smss.exe is runing 0.4MB private memory with 2 threads.

Thanks!

  • 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-05-22T23:30:55+00:00Added an answer on May 22, 2026 at 11:30 pm

    You can reduce your foot print if you don’t include stdlib and make sure not to link in an libraries you don’t use. All linked dlls get there own private data segment and I believe that is included in your private set.


    After removing all STD libs using Yes (/NODEFAULTLIB) setting my optimizations to O1 and setting my entry point winmain to avoid the @_crtstatuperror using this code

    #include <windows.h>
    
    int winmain(    HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpCmdLine,
        int nCmdShow)
    {
    
        HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
        char out[] = "bob";
        DWORD Outchar = 0 ;    
        WriteConsole(h, out, 4, &Outchar,  NULL);
        return 0;
    }
    

    I got the memory usage down to 292K with out getting really exotic I don’t think you could get it a lot lower

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

Sidebar

Related Questions

I've got a lot of similar oracle jobs I need to create, and I'd
I work a lot with external Web Services, and I need to create an
I want something simple in order to experiment/hack. I've created a lot interpreters/compilers for
I'm about to create a web application that requires a lot of different web
Create a flat text file in c++ around 50 - 100 MB with the
My program, alas, has a memory leak somewhere, but I'll be damned if I
I've never used Smalltalk, but I've read a lot about it and it has
I have to create an application which automates Outlook and Word and I want
I notice in several API's, that you may create a struct which is used
I need to solve the following question which i can't get to work by

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.