Quantcast
Channel: LoadRunner Practitioners Forum topics
Viewing all articles
Browse latest Browse all 3978

Error -- memory violation : Exception ACCESS_VIOLATION received.

$
0
0
So I am having issues with getting C interpreter errors - memory violation when running the script on most of our load generators. We have a couple server 2003(8gb ram) load generators that the script runs fine on. However all of the windows 7 machines (4gb ram) will not run the script. My first inclination is that its just running out of memory, however when I watch the resources on the 2003 server when its running it increases only 200mb of memory when I run the script. What the script does: It reads a file into memory, that buffer is then assigned to a LR paramater, that parameter is then assigned to an attacment of a MTOM SOAP request. When using small files 20mb and below I can run it in VUgen, larger files such as 85mb, I get Memory Access Violation. I then have to run it through performance center, using the 2003 Server Load Generator, which it runs and executes fine. Since it runs on the machine with more memory I would have thought it was more due to memory available, yet when the script runs, not much is used on the 2003 server LG. Any insight on this would be great! Code: #define SEEK_SET 0 /* beginning of file. */ #define SEEK_CUR 1 /* current position. */ #define SEEK_END 2 /* end of file */ int requestPrepared = 0; char *filename2 = "test.gz"; setEXTERNALfile() { long infile; // file pointer char *buffer; // buffer to read file contents into //Old Code //char *filename = "C:\\EPD\\INDIVIDUAL\\XML\\EPDIndividual_1.xml"; // file to read. old code. //Old code char *filenumber[15]; int fileLen; // file size int newfileLen; // New file size int fileSizeSub; //linix file si int bytesRead; // bytes read from file char newfilename[40]; //contains file name path char *fileext = ".xml"; // ext of file to read typedef void *gzFile; gzFile file; int count; //char *filenumber2[40]; char filename[155]; char fileDirectory[155]; sprintf(fileDirectory, "%s", lr_eval_string("{pFileDirectory}")); lr_output_message("Current fileDirectory %s", lr_eval_string("{pFileDirectory}")); sprintf(filename, "%s", lr_eval_string("{pFileName}")); // 80 MB file sprintf(newfilename,"\\\\LOCATION\\%s\\%s%s", fileDirectory, filename, fileext); // open the file infile = fopen(newfilename, "rb"); if (!infile) { lr_error_message("Unable to open file %s", newfilename); return; } // get the file length fseek(infile, 0, SEEK_END); fileLen=ftell(infile); newfileLen=ftell(infile)+2; fseek(infile, 0, SEEK_SET); lr_log_message("File length is: %9d bytes.", fileLen); lr_save_int(newfileLen,"pNewFileSize"); lr_log_message("New File length is: %9d bytes.", newfileLen); // Allocate memory for buffer to read file buffer=(char *)malloc(fileLen+1); if (!buffer) { lr_error_message("Could not malloc %10d bytes", fileLen+1); fclose(infile); return; } // Read file contents into buffer bytesRead = fread(buffer, 1, fileLen, infile); if (bytesRead != fileLen) { lr_error_message("File length is %10d bytes but only read %10d bytes", fileLen, bytesRead); } else { lr_log_message("Successfully read %9d bytes from file: ", bytesRead); } fclose(infile); // Save the buffer to a loadrunner parameter lr_save_var( buffer, bytesRead, 0, "fileDataParameter"); free(buffer); //lr_log_message("File contents: %s", lr_eval_string("{fileDataParameter}"));

Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>