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 5943955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:28:09+00:00 2026-05-22T16:28:09+00:00

I have an app with a number of worker threads, one for each core.

  • 0

I have an app with a number of worker threads, one for each core. On a modern 8 core machine, I have 8 of these threads. My app loads many plugins, which also have their own worker threads. Because the app uses huge blocks of memory (photos, e.g. 200 MB) I have a memory fragmentation problem (32 bit app). The problem is that every thread allocates the {$MAXSTACKSIZE …} of address space. It’s not using the physical memory but the address space.
I reduced the MAXSTACKSIZE from 1 MB to 128 KB, and it seems to work, but I don’t know if I’m near to the limit. Is there any possibility to measure how much stack is really used?

  • 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-22T16:28:10+00:00Added an answer on May 22, 2026 at 4:28 pm

    Use this to compute the amount of memory committed for the current thread’s stack:

    function CommittedStackSize: Cardinal;
    asm
      mov eax,[fs:$4] // base of the stack, from the Thread Environment Block (TEB)
      mov edx,[fs:$8] // address of lowest committed stack page
                      // this gets lower as you use more stack
      sub eax,edx
    end;
    

    Another idea I don’t have.

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

Sidebar

Related Questions

I have an app that creates a variable number of ScatterviewItems based on which
I have an view in my App which has a number of buttons based
We have a backbone.js app that displays a number of forms to the user.
In my app I want to call to selected number. For this I have
I have a tableView which has cells with phone numbers. The app is not
I have app in which i have recorded sound files i want that i
for example: I have app A, which references library A and library B. in
.net 2.0 aspx app / IIS6 creating a silly number of threads in w3wp.exe
A Ruby on Rails app will have access to a number of images and
I have a C++ app in which I create pthreads to run user provided

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.