全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
6556 3
2009-12-23
由于我利用循环语句处理数据,每次循环时数据量非常大,结果发现随着循环次数的增加,运行的速度越来越慢,因此我想在每次循环结束时将内存释放出来,应该怎么做?我查到"PROC RELEASE"似乎可以,但我具体怎么用,希望高手指点一下,谢谢了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2009-12-23 12:01:51
1# astraes

First the proc release is to disk space instead of RAM. It is Not going to help in your case. Here is details


Details
PROC RELEASE can be used with most sequential or partitioned data sets, not just with a SAS library that contains SAS data sets. However, PROC RELEASE is not supported for, and cannot be used to release unused space from, the following types of data sets:
  • the SAS WORK library
  • extended partitioned data sets (PDSEs)
  • ISAM or VSAM data sets
  • multivolume SAS libraries
  • external multivolume data sets.

Second if you pose a sample you problem, it will help others to understand what is you bottle-neck in your programs.

HTH
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-12-23 16:49:35
虽然我用了“dm "out;clear;log;clear;"; ”命令,但好像只是清除了输出窗口,每次循环用到的数据和生成的数据还是留在了内存中,这样就导致随着随机次数的增加,内存占用就越来越大,使得每一次循环都要比上一次慢,我怎么才能清空呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-12-23 22:57:06
3# astraes

What you did is nothing to do with RAM/Memory.

As I undersatand, before SAS executes a program(data step/procs), SAS complier will calculate the memory requirments. If it cannot allocate memories, it issues an error. A User does/is not need/allowed to manage the memory allocation.

30   data _null_;
31     array x (1000000000) _temporary_;
FATAL: Insufficient memory to execute DATA step program. Aborted during the COMPILATION phase.
NOTE: The SAS System stopped processing this step because of insufficient memory.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

32     stop;
33     run;

You may be better off to pose your problem in details, others may come up a better idea for your problem.

HTH
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群