Problem Note 67585: A large amount of memory is used for code that creates hash objects in SAS® Cloud Analytic Services (CAS)
You might observe excessive use of memory by CAS on SAS® Viya® 3.5. This problem might occur when you run SAS® code for hash tables that use multiple threads. The following syntax is an example:
data CASUSER.test(copies=0);
do ArticleId=1 to 28502;
do Date=today() to today()+120;
article_new_flg=0;
Promotion_flg=0;
output;
end;
end;
run;
data CASUSER.secondtest(copies=0) / sessref=mySession; /*8 threads*/
if 0 then set casuser.test;
if _N_ eq 1 then do;
declare hash scoreh(dataset:"CASUSER.test");
scoreh.definekey('ArticleId', 'Date');
scoreh.definedata('article_new_flg', 'Promotion_flg');
scoreh.definedone();
end;
rc = scoreh.check();
stop;
run;
The excessive memory usage occurs because each thread is allocating the hash tables in memory separately.
Currently there is no workaround. But you can reduce memory consumption significantly with a slight loss in performance by using this declaration with the following highlighted addition:
declare hash scoreh(dataset:"CASUSER.test", hashexp: 8);
Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.
Operating System and Release Information
SAS System | SAS Viya | Linux for x64 | 3.5 | 3.5 | Viya | Viya |
Microsoft® Windows® for x64 | 3.5 | 3.5 | Viya | Viya |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2021-03-16 09:43:47 |
Date Created: | 2021-03-11 06:30:13 |