Unsolved Invalid parameter passed to C runtime function
-
@mrjj You mean Hard disk or main memory?
-
Main memory.
the new function can trow that error if you try to allocate and there is not enough free. -
@JNBarchan I already have this issue :O
-
@mrjj so how can I increase the amount of memory?
-
@Lasith
Add more memory to the pc.
But how much does the target currently have ?
Did you check the how much app uses etc?Or find out if you are leaking memory and hence it runs dry.
You have to find out what causes it using the debugger.
Step through the code to find out where or in what context the
error comes.You have not shown any code so its not possible to guess at.
-
@mrjj Thanx how can I check the current memory usage? Using the task manager?
-
@Lasith
Yes it can give a good hint. Start app and see how much it uses.there is also
https://docs.microsoft.com/en-us/sysinternals/downloads/rammap -
Does error comes as soon as you start the app or
does it take some time? -
@mrjj The error oocurs when I click a button which feeds a set of values to a QStringList through 2 for loops!
-
@Lasith
Ok, you might copy a lot around and run out of memory.
is it 32/64 bit app?
how much memory do you have? -
@mrjj I can not check now :( Its in my office PC Now I am home I will notify you tomorrow! :)
-
@Lasith
Ok, if you copy lists, it might be the reason.
You should show the code.
Using all mem with strings, takes a lot of strings :) -
@Lasith said in Invalid parameter passed to C runtime function:
@mrjj The error oocurs when I click a button which feeds a set of values to a QStringList through 2 for loops!
And you're sure those 2 loops aren't actually unlimited? ;-) Better look at how many iterations they do :) You do have to do really quite a lot of iterations to run out of memory!
-
@JNBarchan No the upper limits of the conditions is finite! Any way I will check and see! Plus if its an infinite loop the error message is different as I remember!
-
@Lasith said in Invalid parameter passed to C runtime function:
@JNBarchan No the upper limits of the conditions is finite!
This is good to know. But there are finite numbers and then there are other finite numbers. Numbers like, say, 0x7FFFFFFF (2 billion?) as the limit in each loop (I'm understanding they are nested?) will cause a lot of iterations... ;-)
-
@JNBarchan yeah they are nested for loops!