Thread View: be.comp.programming
2 messages
2 total messages
Started by ColinB
Thu, 12 Oct 2006 08:12
Virtueel geheugen opgebruikt?
Author: ColinB
Date: Thu, 12 Oct 2006 08:12
Date: Thu, 12 Oct 2006 08:12
36 lines
2362 bytes
2362 bytes
Hallo, Ik ben een console type applicatie in vc++ 6.0 aan het debuggen onder win XP met 1 GB aan RAM. De stack allocation linker optie (/stack) staat op 0x3000000. De applicatie probeert 5 worker threads op te starten met _beginthreadex (stacksize altijd op 0). In die threads worden onder andere expliciet libraries geladen met LoadLibrary (en gebruikt). Het probleem is nu dat het starten van de tweede thread faalt: _beginthreadex geeft 0. Het opvragen van errno resulteert in 12 (ENOMEM) of "Not enough memory". Als ik op dat moment de applicatie monitor met Process Explorer van Sysinternals.com toont het me het volgende onder Performance, Virtual Memory: - Private Bytes: 56.600 K - Peak Private Bytes: 56.600 K - Virtual Size: 1.801.284 K - Page Faults: 32.644 - Page Fault Delta: 0 Onder Physical Memory: - Working Set: 61.184 K Vooral de waarde van Virtual Size vind ik nogal zorgwekkend. Dit is de totale virtuele adresruimte gebruikt door het proces dat al of niet geresserveerd is. Ik heb ergens gelezen dat van de normaal 4GB adresseerbare ruimte windows je iets minder dan de helft laat gebruiken. Enig idee hoe ik dit zou kunnen oplossen of een leidraad om de grootte van het virtueel geheugen te beperken? mvg, Colin B.
Opgelost
Author: ColinB
Date: Mon, 16 Oct 2006 08:21
Date: Mon, 16 Oct 2006 08:21
3 lines
1405 bytes
1405 bytes
Die /stack instelling was waarschijnlijk om grote statische buffers toe te laten. Nu deze dynamisch op de heap worden gereserveerd kon ik de grootte verminderen naar 0x1000000 om het probleem op te lossen.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads