AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.01.2015, 13:36   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
We already had few support request where NAV developers see big memory consumption increase when using .NET component.
Especially when method is inside some loop.
Like in this sample:
FOR count := 1 TO 10000000 DO BEGIN
varDOTNET :=varDOTNET.DotNetObject();
varDOTNET.SetValue('par');
CLEAR(varDOTNET);
END;

Even it looks like we create variable and then clear it – we can see continues memory usage increase in windows task manager.
But this is not “memory leak” this is how NAV is managing memory. If you start process again then memory usage decrease and increase to the same number.
So only during processing there could be issue that few users running the same code comes to memory limits.
Resolution is to transfer .NET method execution to local function

FOR count := 1 TO 10000000 DO
CallToFunction(‘par’…………PROCEDURE CallToFunction@1(parameter@1170000001 : Text);
VAR
varDOTNET@1170000000 : DotNet "'MemoryExample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.MemoryExample.DotNetObject";

varDOTNET :=varDOTNET.DotNetObject();
varDOTNET.SetValue(parameters);
CLEAR(varDOTNET);



Also here are other coding ways where you can transfer part DotNet variable execution to functions. But it is always more effective transfer execution to function where "garbage collector" can make his job faster and more effective.



These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

Gedas Busniauskas

Microsoft Lithuania
Microsoft Customer Service and Support (CSS) EMEA




[img]//feeds.feedburner.com/~r/MicrosoftDynamicsNavTeamBlog/~4/M6DVdSJw_oI[/img]

Источник: http://feedproxy.google.com/~r/Micro...omponents.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:09.