skuvvv1
September 29, 2015, 10:48pm
1
Hello all,
I am curious about usage simple functions such as til.
1)type til 10
returns 7h instead 6h
I run at win x64
2)using `int$ till 10 requires 3x times more memory than simple filling by integer values
(4 byte for int instead 8byte for long + 4 byte for conversion)
3)I got wsfull with
aa: til 150000000
ps I just want fast fill big array by integer values(not by longs) and reach 300-400mil of values
skuvvv1
September 29, 2015, 11:09pm
2
Additional thing that can be a reason of wsfull,
when I fill array, kdb allots memory by steps and not by necessary amount,
for example additional 10mil of integers will allocate 500Mb of memory, and next step with 270mil+ will get wsfull:
q)\ts aa: 130000000?1000i634 536871120q)aa: nullq).Q.gc[]536870912q)\ts aa: 140000000?1000i682 1073742032
The default integer type is 64 bit long on both kdb32bit and kdb64bit. http://code.kx.com/wiki/Releases/ChangesIn3.0
22 Limits
Each database runs in memory and/or disk map-on-demand – possibly partitioned. There is no limit on the size of a partitioned database but on 32-bit systems the main memory OLTP portion of a database is limited to about 1GB of raw data, i.e. 1/4 of the address space. The raw data of a main memory 64bit process should be limited to about 1/2 of available RAM.
260 million int32 takes 991 MB
300 million int32 gives a wsfull
list1m:`int$til 1000*1000;
bigList:();
a:0i;
do[260;
bigList,:list1m+a*1000000i;
a+:1i];