SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 67585: A large amount of memory is used for code that creates hash objects in SAS® Cloud Analytic Services (CAS)

DetailsHotfixAboutRate It

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

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS ViyaLinux for x643.53.5ViyaViya
Microsoft® Windows® for x643.53.5ViyaViya
* 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.