Re: Memory Frage

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hallo NG!

"Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach@xxxxxxxxx> schrieb:
Als x86 Programm:
=> Private Bytes: 268 KB (OS: Win7-x64)

Hah, meiner ist kleiner! ;-)

Vista x32 mit Procmon von minimum.exe ausgelesen:

Private Bytes: 136K
Peak Private Bytes: 232K
Virtual Size: 8936K

Working Set: 868K
WS Private: 128K
WS Shareable: 740K
WS Shared: 732K
Peak Working Set: 868K

Nur die 128K "WS Private" belegt dein Programm alleine.

Und die Dateigröße: 736 Bytes;

minimum.asm

;ml /c minimum.ams
;link /nodefaultlib /subsystem:console /merge:.rdata=.data /merge:.data=.text /align:16 /entry:main minimum.obj kernel32.lib

..386
..model flat

;Define const values
STD_OUTPUT_HANDLE equ -11
nTextSize equ 14
lpText equ offset text

; declaration of all used API-functions
extrn _GetStdHandle@4 : PROC
extrn _WriteConsoleA@20 : PROC
extrn _ExitProcess@4 : PROC
extrn _Sleep@4 : PROC

..Data
text db "Hello World!",13,10

..Code
_main:
push STD_OUTPUT_HANDLE
call _GetStdHandle@4

;Make space for WriteConsole's 4th out parameter
push 0
lea ecx,[esp]

;WriteConsole: stdcall is from right to left
push 0
push ecx
push nTextSize
push lpText
push eax
call _WriteConsoleA@20

;Sleep 20 sec to check size in Procexp
push 20000
call _Sleep@4

;ExitProcess
push 0
call _ExitProcess@4

End _main

MfG
Andreas


.



Relevant Pages

  • RE: save and retrieve a text file from a command button
    ... push a command button ... private mWordApp as Object ... private function GetWord() as boolean ...
    (microsoft.public.access.formscoding)
  • Re: Re: Dynamically updating perl variables
    ... push @values, $1, $2; ... the things you want than to try to exclude the things you don't. ... private and confidential ... values of β ...
    (perl.beginners)
  • Whats being thrown away?
    ... In the following snippet of code I'm getting the "useless use of a private ... variable in a void context" error. ... push @days, $day; ...
    (perl.beginners)
  • Some meat on the Xbones
    ... extrn XDefaultRootWindow ... pDisplay rd 1;Display handle ... push ... call XCreateSimpleWindow; create window ...
    (alt.lang.asm)
  • Re: [ASM] OUT on XP
    ... PUSH DS ... mov dx,ad_pcom ... lec_t_port proc far ... lec_t_port endp ...
    (alt.lang.asm)