Sign in to follow this  
Followers 0
nbala75

Error Allocating Memory

6 posts in this topic

#1 ·  Posted (edited)

I use ExcelreadsheettoArray and copy around 5000 rows of data into an array. The size of the excel file is around 3MB.

And then, i open a While loop to get parameters thru an Inputbox.

Using those parameters, i make some calculations on the excelarray and store the result in a Notepad file. The size of the notepad file comes to around 200K.

I do this way bcos, there are multiple ways in which this calculations can be done, and i dont want to use ExcelreadsheettoArray every time since it takes more time each time when i wish to change the parameter and re-run the code.

So when i give input for around 4 or 5 times, i get this error "Error Allocating Memory".

What causes this error to happen and Is there a better way to do my work?

Thanx again for ur help :)

Edited by nbala75

Share this post


Link to post
Share on other sites



"Error Allocating Memory" says you're running out of RAM. With the figures you're mention above, this sounds to me like you're not freeing up variables behind you correctly and / or are duplicating variables (in a large loop?). Can't point out the details without some code provided :) ...

Share this post


Link to post
Share on other sites

Ok

I dont know which part of the code to put it here

If u can provide some links to Help topics on Freeing up Variable, i will go thru it and get back to u

Thanx

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$var = 0 will delete a variable, $aArray = 0 will delete an array, it's quite easy in fact, if you don't need them anymore, delete them. Note that local variables and arrays will automatically be freed when function finishs (help-file pages to read: "Dim / Global / Local / Const", "Language Reference - Variables").

Edited by KaFu

Share this post


Link to post
Share on other sites

What KaFu said and maybe using the "Reduce Memory" Function which can be found in WinAPIEx.au3 by Yashied, search for _WinAPI_EmptyWorkingSet()


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Kafu

think i have been indiscriminately using Global

So let me check that and get back

thanz again

thanx to Guinness...let me look for that as well

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0