memory violation : Exception ACCESS_VIOLATION received

Error Statement:

C interpreter run time error: Action.c (<script line number>) :  Error — memory violation : Exception ACCESS_VIOLATION received


While running the script, when a load generator tries to access a piece of memory that either doesn’t exist or access memory in the wrong way, then LoadRunner throws this error.

Possible Causes:

  1. Unclosed file in file handling logic
  2. Attempt to write a string literal
  3. Access memory allocated via web_set_max_html_param_len() function
  4. Using the “Run as a Process” thread execution mode


  1. Use fclose() to close the open files
  2. In Vuser scripts, string literals are read-only. Any attempt to write to a string literal generates an access violation, so avoid this situation.
  3. Set ‘web_set_max_html_param_len(xxxxx);’ appropriately. If it has a large number to capture the maximum data using web_reg_save_param() then try to calculate the max length of the strings per page and add around 30% to it.
  4. Use “Run as a Thread” mode until and unless “Run as a Process” is not required.

You may be interested:

Leave a Comment