Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
#1

Hello, djson annoyed me(Because it spam files in my scriptfiles folder and it didn't do anything in script) and I have deleted it from the script and when I compile, I receive a group of messages:

Code:
Header size:          19160 bytes
Code size:          5151048 bytes
Data size:         22265916 bytes
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:27452508 bytes
I was looked on forum for a solution, but I haven't found it, what's wrong with my script?
I havent used djson in script, only it has been activated on the top of the script(), in OnGameModeInit - djson_GameModeInit(); and in OnGameModeExit - djson_GameModeExit();

Sorry for my bad english, and thank you
Reply
#2

Add this at the top of your script:
Code:
#pragma dynamic 27452508
Reply
#3

Quote:
Originally Posted by Darkwood17
View Post
Add this at the top of your script:
Code:
#pragma dynamic 27452508
I found it on forum, but writter says its for lazy guys, im not lazy

When I activate djson again, i dont receive this messages. Does he have something in the script that solves the problem?
Reply
#4

Quote:
Originally Posted by DusanInfinity
View Post
I found it on forum, but writter says its for lazy guys, im not lazy

When I activate djson again, i dont receive this messages. Does he have something in the script that solves the problem?
Maybe you read this:
Quote:
Originally Posted by Vince
View Post
It only increases the size of stack. Doesn't optimize anything. Usually found in scripts made by people who are too lazy to optimize things themselves, sometimes accompanied by #pragma tabsize 0 because they also don't know how to properly indent.
Yes, this won't optimize anything, it only hides that warning.
You should optimize your gamemode.

I have never used DJson before, so I don't know if the problem in it.
Reply
#5

I cant find tutorial how to optimize script, can you help me? How can I optimize script?
Reply
#6

The old thread was full of tips but was deleted. A part of it though can be found here: https://sampforum.blast.hk/showthread.php?tid=571550
Reply
#7

You say that when you stop using djson everything gets fixed.So it is problem in that include.Could you please tell me which include is it?

The error which you got is triggered when there is a recursive function or you passing large strings as arguments and for many other reasons where you need huge stack/heap.

Quote:
Originally Posted by Darkwood17
View Post
Add this at the top of your script:
Code:
#pragma dynamic 27452508
Never try to get rid of warnings/errors using bad methods.
Reply
#8

Quote:
Originally Posted by Yashas
View Post
You say that when you stop using djson everything gets fixed.So it is problem in that include.Could you please tell me which include is it?

The error which you got is triggered when there is a recursive function or you passing large strings as arguments and for many other reasons where you need huge stack/heap.



Never try to get rid of warnings/errors using bad methods.
No no no, when i stop using djson, i get this messages.
Reply
#9

It is probably because djson has #pragma dynamic within the include which increases the heap size.If you remove it the default setting will be used which is not sufficient for your script.

"due to recursion" means that you have a function like this
Code:
stock func(n)
{
       if(n == 10) return 0;
       else func(n+1);
}
You are calling the same function within a function.Search for your code and find such functions and post them here so that we can tell you how to improve it.
Reply
#10

Quote:
Originally Posted by Darkwood17
View Post
Add this at the top of your script:
Code:
#pragma dynamic 27452508
Cool, it works.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)