Can I recover how much memory a instance use?

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
We work with a lot of projects with "resstart instance" every few runs, but we need to optimize more and more. At this time we are looking on memory usage.
Command instance.MinimizeMemory() work but we need to have a litle more control.
Sometimes we loop a lot in certains web pages, and, to do login and all verifications (including hardware verifications with human fingerprints, etc), this process requires a human and in two specific portals, need a lot of time, so skip login give us at least 7 min in each restart instance.
Actualy we set to restart instance after 3000 loops, in this time, if no problems was found, the instance use 1.8GB RAM, but if problems are found like "waiting answer", that 3000 loops can use only 600MB.
After 1.4GB RAM the project run slowly.
We need to see, if current instance beat 1.4GB, restart instance, else, continue running.
Can I monitor how much memory a instance have in own use?
 
  • Спасибо
Реакции: Yuriy Zymlex

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 219
Благодарностей
5 843
Баллы
113
There is an option - Max amount of memory in Instance settings.
Max amount of memory.png
If base with instances will use more then this amount, it will be set to automatic restarting.
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
I think this settings not work, my setup have default value "160" and my task ever uses more than 160MB.
I tell as instance, a browser instance.
 

Вложения

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
I want to resstart this instance, as you see, the maximum value in settings is 1024MB an this already reach that value.
 

Вложения

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 219
Благодарностей
5 843
Баллы
113
I want to resstart this instance, as you see, the maximum value in settings is 1024MB an this already reach that value.
It is restarted not exactly at 1024 Mb. It is marked to restart after reaching this max and will be restarted at suitable moment, for example, when current thread finished execution.
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
Thats the problem, I want to know how much memmory my task have in use under execution.
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
As example, I want to resstart it now!
Like I said in 1st post, I expect to have 1.6GB ram in use after 3000 loops (without need login again), today we got a lot of goodies, and in 480 loops the project beat 2.2GB.
I can retreive instance port and pid in instance window when I click in "show", there is a command to retreive instance PID from C# code?
 

Вложения

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
Bump!
I want to restart that instances who eat 5 GB / 3GB RAM.
 

Вложения

  • 55,6 КБ Просмотры: 266

Yuriy Zymlex

Moderator
Команда форума
Регистрация
24.10.2016
Сообщения
6 367
Благодарностей
3 292
Баллы
113
API does not have methods for this, as I know. You only can release instance.
https://help.zennolab.com/en/v5/zennoposter/5.30.0.0/webframe.html#topic301.html
https://help.zennolab.com/en/v5/zennoposter/5.30.0.0/webframe.html#topic743.html

Здравствуйте.

ReleaseInstance должен использоваться в связке с GetNewInstance, т.е. Вы может самостоятельно запускать инстансы, производить с ними какие-либо действия, затем освобождать их.
Для работы этих методов должен быть запущен ZennoPoster.
Обычно незачем эти методы использовать, так как ZennoPoster сам всё это делает.
ReleasePreparing соответствует названию - флаг поднимается только при освобождении инстанса.
MinimizeMemory вызывает сборщики мусора в инстансе, и инстанс освобождает память, какую может.

ZennoLab Support
Если поставить ReleasePreparing true, то в инстансе перестанут инициализироваться новые вкладки, трафик монитор будет рвать все запросы.
Если Вы собирается самостоятельно создавать инстансы, их контролировать и освобождать, то этот метод понадобиться, а так лучше его не трогать.

ZennoLab Support
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
Sure, but I don't know how much memory a instance have in use.
I need to know instance PID or enter a command to retreive memory usage before release instance.
We already use instance.minimizememory to try reduce resource usage but garbage is not our real problem.

When I select "show instance" in Zenno Poster, the Window show me Instance Port and PID.
Can I get It?
 

Yuriy Zymlex

Moderator
Команда форума
Регистрация
24.10.2016
Сообщения
6 367
Благодарностей
3 292
Баллы
113
Try instance.FormTitle, but in some version output has been changed.
 
  • Спасибо
Реакции: EtaLasquera

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
  • Спасибо
Реакции: Yuriy Zymlex

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)