One of the first questions to ask when investigating performance issues is “Which license server is the tool looking at?”


Very often, the answer is “It’s looking at the right server, but it’s checking it a number of times for each license”.


On Windows, Mentor tools typically look for licenses in five locations:



  • MGLS_LICENSE_FILE environment variable
  • MGLS_LICENSE_FILE registry value
  • LM_LICENSE_FILE environment variable
  • LM_LICENSE_FILE registry value
  • C:\flexlm\license.dat



(On Linux / Unix only the environment variables are used.)


If your license server is listed in both the environment variables and both registry values – then the server can be checked four times for every license request!


Some tools check a number of licenses to determine what options are available, so if you do not have that license, you are getting the same “No license here” answer four times.  (If a license server is listed multiple times in an environment variable – it can be checked even more often.)



Each license server only needs to be listed once.  If a server is listed more than once, remove the duplicate entries.

The MGLS_LICENSE_FILE variable / registry value is only used by Mentor tools, whereas the LM_LICENSE_FILE settings are used by all tools that use FlexNet.  (If you only want Mentor tools to check Mentor license servers, define the Mentor license server in MGLS_LICENSE_FILE, and set MGLS_LICENSE_SEARCH=1 to stop them checking LM_LICENSE_FILE.)


How to make the changes


The Mentor Licensing Utility provides a simple method of editing your license variables.

Use it to remove any duplicate entries.  In the example below, the two highlighted entries can be removed.