Skip to Content
Author's profile photo Former Member

How to help find a possible source of a DI Performance Issue

Performance issues can occur with DI Objects and symptoms include Long Processing Time or an eventual crash. In this blog we will highlight some steps that can be taken and tools you can utilise to help you identify the performance issue.

1. Test without the Add-on running

While it seems like a simple thing to do testing the same functionality in Business One is an important step. While the performance issue might occur in your add-on it may also occur in Business One pointing to the fact that it is a core performance issue and not an DI performance issue.

2. Check if there is a memory leak

The Task Manager is the easiest way to detect if there is a memory leak.   

a. Create a small sample to replicate the scenario.

b. Open the Task Manager and choose the Performance tab.

c. Run your sample and monitor the CPU Usage and the Page File Usage in the Task Manager.


When starting the Add-on:

  • CPU usage starts at 0 and will rise to 100%
  • Page File Usage starts low and gradually increases. Under normal circumstances it will grow but will be released when the Add-on finishes.


When ending the Add-on:

  • CPU Usage peaks to 100% regularly
  • Page File Usage remains very high and is not released = this indicates a memory leak.



3. Check if there is a problem with a query

Another cause for a DI Performance issue might be that a query triggered by the Add-on takes quite a while to run. We can use the SQL Profiler to verify if this is the cause.

a. Create a small sample to replicate the scenario.

b. Open the SQL profiler (Start -> All Programs -> Microsoft SQL Server 2005 -> Performance Tools -> SQL Server Profiler).

c. Select File -> New Trace and connect to the SQL Server if prompted. Provide the Trace file a Trace name.

d. Click on the Events Selection tab. Select the checkbox “Show all columns”.

e. Click Column Filters and the Edit Filter window will open. In this window you can assign the DatabaseName, LoginName or other filters to narrow down the results returned.

f. Just before running your Add-on click Run and then run your Add-on.

g. Save your trace file.



Open the trace file and the three columns to analyse are:

  • ApplicationName (application calling the queries)
  • LoginName (database user you are logged on with)
  • Duration (time it takes for the query to run (milliseconds)

The parameters we will look at include the duration of each query – 105020 is about 1.75 mins and would be indicative of an issue. The number of SQL queries generated can also indicate an issue – if an unacceptable number of queries are generated eg 80000 then it may be the reason.


4. SAP Business One Test Tools

The SAP Business One Test Environment is a set of software tools that help profiling the execution of a solution. They are available to download on the SDN and you can download the latest version of the B1TE from

DI Logs Reader

Starting on SAP Business One 2007A version the DI API is able to generate log files tracing all calls made from an add-on to the DI API. The B1DILogsReader is then able to open the DI API logs files and show the information in a very easy way to read. Some of the information recorded is:

  • Time of the call
  • Elapsed time the DI API needed to return the answer back
  • Interface ID giving the reference of the interface instance
  • Interface name of the class being called
  • Method or Property called in the interface, preceded by Set or Get if setting/getting properties
.Net Profiler

This tool keeps track of all the DI API and UI API methods called from a .NET add-on. The tool produces information about the time spent, the exception raised, and possible compatibility problems.

For each call, the following information is collected:

  • Time the function call was executed
  • The Name of the process executing the profiled function call
  • The Win32 Thread Id of the thread executing the profiled function call
  • Whether the call belongs to DI API or UI API
  • Name of the class to which the method belongs
  • Name of the called method
  • For UI API or DI API method calls, the time elapsed to complete the call

If you do suspect there is a memory leak in the DI we would recommend that you log a support message providing the exact scenario, the results and a small sample to reproduce and verify the issue.


Our next blog will cover some DTW Top tips so catch you then 🙂

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.