Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


User Defined Function - memory usage

Keywords:   User Defined Function - memory usage 

Question:

If a UDF is called many, many times will it reuse memory or will it eventually run out. Is the DROP command required, or is it automatic on return.

Answer:

In general, variables do not need to be dropped.

However if you open files, they should be closed. If you open OLE handles, they should be closed. If you allocate binary buffers, they should be freed.

In general there are not problems and it does not run out of memoery.

Of couse if the UDF calls itself, and becomes a recursice UDF, there is a limit as to how deep it can go.

Basically you can possibly get into memory trouble with a UDF, but the problem will not be the UDF itself, but rather some peculiar thing that you are doing within the UDF.