轉:Loadrunner報錯“Too many local variablesAction.c”解決方案

來源:互聯網
上載者:User

標籤:http   io   os   使用   ar   strong   for   div   sp   

問題描述,在Action.c裡定義數組時如果數組長度過長,如char a[1024*1024]運行時即會報錯:

問題原因及解決方案如下:

1. VuGen對於局部變數可以分配的最大記憶體為64K,如果想分配空間大於64K的變數的話,需要通過如下方法:

VuGen has a limitation of 64K for local variables. If you want to declare a variable larger than 64K:

a. 將其定義為全域變數,Declare it globally.

1 char buffer[100000];
2  
3 Actions()
4  
5 {
6  
7 return 0;
8  
9 }

b. 使用malloc()來分配記憶體,Use malloc() to allocate the memory.

查看原始碼 列印協助
1 Actions()
2  
3 {
4  
5 char *buffer = (char *) malloc(100000);
6  
7 /*Remember to free it when you do not need it*/
8  
9 free(buffer);
10  
11 return 0;
12  
13 }

2. 如果在錄製指令碼後進行回放時報錯,可以按照下面步驟進行配置:

If you have this problem replaying a large database script in LoadRunner 7.8 or above, immediately after recording.

a. Go to Tools -> Regenerate Vusers...

b. Click on ‘Options...‘ to edit the recording options

c. Under General:

1. Script section, enable the option for "Split action section to functions by event".By default, this is not enabled and it has a value of "500". This option is useful for when the action section is rather large

2. Script and select "Maximum number of lines in action file", change the value to 30000 and regenerate again

 

轉:Loadrunner報錯“Too many local variablesAction.c”解決方案

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.