[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Anton Venter

9/28/2005 10:31:00 PM

Hi all,

We have some code in Axapta 3.0 SP3 that generates purchase orders.
Because we are creating alot at a time, Axapta eventually runs out of
memory
and then finally crashes. We get a 'Smartheap library' error message when
running two tier and an 'AOS has lost the connection' error message when
running three tier. It seems that the kernel is requesting memory to create
new objects but there is none available (or it is simply denied more
memory).
The problem is that is not freeing the memory of unused objects.

The server on we are using has 8GB of RAM. The crash usually occurs around
the 2GB. We have identified some code where this memory allocation occurs.
It is in the createLine method in the PurchLine table.

Is there a way to keep the memory usage constant or to free the memory?
Has anybody found a way around this?

Thanks
Anton



3 Answers

Daniel Biesiada

9/29/2005 10:25:00 AM

0

> Is there a way to keep the memory usage constant or to free the memory?
> Has anybody found a way around this?

Sounds like a terrible memory leak in your code. Have you analyzed your
code in that context? Both if you free correctly your objects and if
they are correctly initialized on server/client side. If you still have
memory at your AOS server available and your axapta crashes due to
memory problems check if it''s all really processed on server side also.

best regards,
Daniel Biesiada

Joris de Gruyter

9/30/2005 7:05:00 AM

0

> Sounds like a terrible memory leak in your code. Have you analyzed your
> code in that context? Both if you free correctly your objects and if they
> are correctly initialized on server/client side.

Unfortunately there''s no pointers so "freeing correctly" is not something
people do or need to do.
However, if you want to free up classes before they run out of scope you
could assign NULL to the object, which will force the garbage collector to
free up the memory used. But i''m not too sure this will help you all that
much.


Daniel Biesiada

9/30/2005 8:49:00 AM

0

Joris de Gruyter wrote:
>>Sounds like a terrible memory leak in your code. Have you analyzed your
>>code in that context? Both if you free correctly your objects and if they
>>are correctly initialized on server/client side.
>
>
> Unfortunately there''s no pointers so "freeing correctly" is not something
> people do or need to do.

In visual basic you had no pointers also and garbage collecting showed
that you have to follow some basic best practices not to see your
application working incorrectly in context of memory usage. I''ve
experienced similar thing in Axapta X++ in one past project. I thought
that everything is ok but memory usage in the system seemed to me at
least confusing. After all checks for object references I discovered
that even in X++ it''s just to easy to make a memory leak.

> However, if you want to free up classes before they run out of scope you
> could assign NULL to the object, which will force the garbage collector to
> free up the memory used. But i''m not too sure this will help you all that
> much.

That''s what I meant by freeing correctly. Assigning nulls and checking
if some object referencing doesn''t go out of control.

best regards,
Daniel