Nologic Posted May 1, 2009 Share Posted May 1, 2009 If you run the below script as is...it works fine, but if you uncomment ether "GUISetState" or "MsgBox" it will toss a memory error...anyone got any bright idea's? #include <WinAPI.au3> GUICreate("My GUI") ;GUISetState( ) GUIDelete ( ) ;MsgBox(0, "Test:", 'test' ) $String = '1185760800' $tBuffer = DllStructCreate("char[" & Number ( $String ) & "]") $tBuffer = 0 MsgBox(0, "Finished:", 'Done' ) Link to comment Share on other sites More sharing options...
monoceres Posted May 1, 2009 Share Posted May 1, 2009 I cannot reproduce. However you do realize you're trying to allocate 1.2 GB of memory? It's possible you're running out of system memory or something. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Nologic Posted May 1, 2009 Author Share Posted May 1, 2009 Yeah realize how much I'm buffering...but I have 3gigs of memory 2 of which is free...and not seeing why I'm getting the error when displaying a messagebox...or having a gui display then being destroyed. Works fine other wise. Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 1, 2009 Share Posted May 1, 2009 No good program needs a buffer that large. Link to comment Share on other sites More sharing options...
Nologic Posted May 1, 2009 Author Share Posted May 1, 2009 (edited) Well it does if is going to split a large binary file. Really how big the buffer is...is not the issue I'm concerned with...but more why it fails (for me) when a messagebox is displayed, where if it not displayed it works fine. Edited May 2, 2009 by Nologic Link to comment Share on other sites More sharing options...
monoceres Posted May 2, 2009 Share Posted May 2, 2009 Well it does if is going to split a large binary file.Ehm no?Really how big the buffer is...is not the issue I'm concerned with...but more why it fails (for me) when a messagebox is displayed, where if it not displayed it works fine.You're right, so since I cannot reproduce more info is needed. For starters, is the error coming from autoit or windows? Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Nologic Posted May 2, 2009 Author Share Posted May 2, 2009 (edited) Heh okay your right it doesn't need to be that large...I'm trying to be lazy. The error is from AutoIt version 3.3.0.0 Now if I set: $String = '1000000000' everything works fine, but at the original value things go wrong. I'll see if I can find where the breaking point is. Edited May 2, 2009 by Nologic Link to comment Share on other sites More sharing options...
Nologic Posted May 2, 2009 Author Share Posted May 2, 2009 (edited) Exact values for my system prior to error: $String = '1112735712' ; With both GUISetState & MsgBox Enabled $String = '1255538656' ; With both disabled So a difference of about 136MB...thats rather large. Edited May 2, 2009 by Nologic Link to comment Share on other sites More sharing options...
Yashied Posted May 2, 2009 Share Posted May 2, 2009 I think this is due to fragmentation of memory. The maximum contiguous block of memory in your case ~1.2GB. Your first example works for me, and without comment. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Nologic Posted May 2, 2009 Author Share Posted May 2, 2009 (edited) Well I'm not sure if fragmentation is the issue...as after rerunning the script several times I'm seeing that any GUI stuff displayed strips 136mb of my available resources...that seems really heavy. Anyways I can and will work around this...just seemed odd that I'd lose 136mb and not have it reclaimed after the destruction of the GUI object. Edited May 2, 2009 by Nologic Link to comment Share on other sites More sharing options...
Yashied Posted May 2, 2009 Share Posted May 2, 2009 Try set /3GB option in your booy.ini file. But I see no reason to create a structure of such a large size. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Nologic Posted May 2, 2009 Author Share Posted May 2, 2009 I've tried that before but it doesn't seem to take on my system for some reason. Well its not required to make one that large by any means in the present day...I was mostly looking to see if anyone had a work around for this curiosity I bumped into. That and a blank GUI eating up that much resources has to be a bug of some sort. All that said, thanks guys for your input and time. Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 2, 2009 Share Posted May 2, 2009 The use of resources is the large structure. Many large-file programs use a buffer of about 64 kilobytes for a max. That is a fine space to allocate and it's not often you need more data than that at one time. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now