Jump to content
UBot Underground

Memory Management With Local Variables


Recommended Posts

There are 2 problems

1) custom commands taking memory that doesn' t clean. Each run consume more memory. The only way to clean the memory is to press Node View that is not possible in compiled bot.

loop(10000) {
test()
}
define test {
}

2) Local variables in defines take space that doesn' t free if you don' t place empty

set(#post,"big string","Local")
set(#post,"","Local")

post-26970-0-15604900-1458594916_thumb.jpg

post-26970-0-91435800-1458594918_thumb.jpg

post-26970-0-11775400-1458594924_thumb.jpg

post-26970-0-13322200-1458594928_thumb.jpg

post-26970-0-89390800-1458594932_thumb.jpg

Edited by heopas
Link to post
Share on other sites

That is interesting!!

PLEASE report this in the tracker...

 

http://wiki.ubotstudio.com/wiki/Main_Page

 

A variable should be cleared if it is "Local: on its own like in a function.

 

 

you can try setting that variable like this

 

set(#time,"","Local")

 

this will clear it until it is set next time
so set that after you the set to get time.

is this for this example?

I am curious why u just don't use your $get time function... Is it for the UI?
 

Also you might want to take a look at this thread...

http://network.ubotstudio.com/forum/index.php/topic/19192-tut-defines-the-how-to-use-them-and-why-you-should-always-use-them/

It would be more helpful to post the code instead of a pic, btw.
 

Hope that helps,

CD

Link to post
Share on other sites

also if you switch tabs this will clear that bot
 

it will also stop it if it is running

 

 

Might want to follow this thread too...

 

http://network.ubotstudio.com/forum/index.php/topic/19145-journey-the-ultimate-ubot-bot-build-plugin-free-bot-no-plugins-are-used/

 

I am doing some test and I will play with these ideas too.

Looks like the UI is not the only leak.

 

CD

Link to post
Share on other sites

In ubot 4

 

 

I used to open another instance of the bot then close current bot and it would run forever

 

 

I would run that particular bot till I figure out the time it would die (15-20 minutes) then use a timer to open new one and close old one.

CD

Link to post
Share on other sites

Another thing you can do

is set it in a list item

 

clear list

 

add item to list

$list item, 0

put that in a command and it should just take one memory location without building. Should!!

but if I knew exactly the purpose I can help u better

Link to post
Share on other sites

Hello, first of all thanks for your reply.

 

Already tried without any luck:

clear all data

set(#time,$nothing,"Local")

add item to list , clear list

 

Same problem exist on compiled bot but I can't press node view to clear memory.

Link to post
Share on other sites

Have you tried the large data plugin by nev123? for the list?

I dont understand what this means.

"I can't press view to clear memory."

 

looks like you have 4GB of memory...

try running less programs too, while using ubot studio

 

is this your whole program?

can you post the code to what is in the screenshots please?

 

CD

Link to post
Share on other sites

After some tests i figured out that same problem appear without variables. Try the same code without any set in define (empty define) memory keeps going up...

Link to post
Share on other sites

the memory.ubot file is missing what ever was in the define so it is useless

 

the other one

ran fine but I dont understand the point

 

perhaps upgrade your ram?

 

need to explain more for me to help please

Link to post
Share on other sites

Create a new script and try to following:

loop(10000) {
test()
}
define test {
}

Memory keeps going up on every Run but if you press Code View and back to Node View memory is cleared.

  • Like 2
Link to post
Share on other sites

Create a new script and try to following:

loop(10000) {
test()
}
define test {
}

Memory keeps going up on every Run but if you press Code View and back to Node View memory is cleared.

 

 

There is a workaround that works in "most" cases, and worth a try, ..

if you place a "load html" node to load say every 10 or 20 or 50 or whatever loops then UBot memory clears (Ubot or Compiled bot)

 

doesnt have to be anything in the node an empty one will do, 

try it out and let us know ;)

 

 

 

Cheers

CJ

  • Like 1
Link to post
Share on other sites

There is a workaround that works in "most" cases, and worth a try, ..

if you place a "load html" node to load say every 10 or 20 or 50 or whatever loops then UBot memory clears (Ubot or Compiled bot)

 

doesnt have to be anything in the node an empty one will do, 

try it out and let us know ;)

 

 

 

Cheers

CJ

 

Already tried that and it only clear Browser.exe memory that i don' t use at all.

There are 2 problems

1) custom commands taking memory that doesn' t clean

2) Local variables in defines take space that doesn' t free if you don' t place empty

Second problem example:

set(#post,"big string","Local")
set(#post,"","Local")
Link to post
Share on other sites

Here is a temp solution

 

like I mentioned above...

make another tab

 

I made one in the attached bot. It has a button for the user to click, to "clear memory"

 

that way they think they did something

 

works like switching to code view and back to node view.

clear memory.ubotclear memory.ubot

 

I will make another bot to show how to do this by opening a new bot and closing current bot.

In a few.

CD

Link to post
Share on other sites

Here is a temp solution

 

like I mentioned above...

 

make another tab

 

I made one in the attached bot. It has a button for the user to click, to "clear memory"

 

that way they think they did something

 

works like switching to code view and back to node view.

attachicon.gifclear memory.ubotattachicon.gifclear memory.ubot

 

I will make another bot to show how to do this by opening a new bot and closing current bot.

In a few.

CD

This method doesn' t work on bots that

1) running with /hide

2) auto work for hours and user is away.

Link to post
Share on other sites

Oh, didn't know you were hiding something :) lol

 

so now I know u are using /hide

when I get time I will show you how to use

 

the shell command to start your bot... oh, wait a second you should know if using /hide

 

well just do that after about 15 min.

start new instance and then either "kill" the current instance of your bot using shell or

there is small free plugin called close bot
http://network.ubotstudio.com/store/product/close-bot-plugin/

or http://forum.thewindowsclub.com/windows-tips-tutorials-articles/29463-kill-processes-using-command-prompt-windows-7-8-a.html

make a sequence of commands to end your bot after 15 mins
stick it a thread
with a wait command
wait 900
save stuff if u need to
start bot
close current bot

or if you get thru say 200 loops of your bot in 15 min., just do that many loops and

save stuff if u need to
start bot
close current bot

There, now I dont need to make example. :)

let me know if that makes sense.
CD

Link to post
Share on other sites

I already know this tactic but is not correct.

There are situations where bot can' t be restart for many hours because every second matter.

For me this is a very critical bug that should be fixed as soon as possible.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...