查看: 1196|回复: 1

奇怪的初始化多个数组问题

[复制链接]
论坛徽章:
0
发表于 2017-4-17 12:12 | 显示全部楼层 |阅读模式

Julia

zeros能申请100万个,zeros(Int32)就不行

julia> @time map(x->zeros(100),1:10);
  0.080405 seconds (54.45 k allocations: 1.958 MiB)

julia> @time map(x->zeros(100),1:10^2);
  0.065097 seconds (14.01 k allocations: 604.570 KiB)

julia> @time map(x->zeros(100),1:10^4);
  0.065116 seconds (23.96 k allocations: 9.090 MiB, 8.39% gc time)

julia> @time map(x->zeros(100),1:10^6);
  5.549026 seconds (1.01 M allocations: 858.938 MiB, 93.54% gc time)

julia> @time map(x->zeros(Int32,100),1:10^6);
WARNING: Force throwing a SIGINT

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6546b378 -- unknown function (ip: 6546B378)
while loading no file, in expression starting on line 237
Allocations: 3833751 (Pool: 3832497; Big: 1254); GC: 209
回复

使用道具 举报

论坛徽章:
0
 楼主| 发表于 2017-4-19 16:17 | 显示全部楼层
换了一个版本
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0-pre.beta.187 (2017-04-17 23:06 UTC)
_/ |\__'_|_|_|\__'_|  |  Commit 55c97fb* (1 day old master)
|__/                   |  i686-w64-mingw32

julia> @time map(x->zeros(100),1:10^4);
  0.102166 seconds (52.64 k allocations: 10.361 MiB, 52.56% gc time)

julia> @time map(x->zeros(100),1:10^6);
18.355380 seconds (1.01 M allocations: 858.722 MiB, 31.28% gc time)

julia> @time map(x->zeros(100),1:10^4);
  0.717004 seconds (19.95 k allocations: 8.989 MiB, 23.32% gc time)

julia>

julia> @time map(x->zeros(Int32,100),1:10^6);
  3.612578 seconds (1.01 M allocations: 523.511 MiB, 89.76% gc time)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

 

GMT+8, 2019-8-22 02:41 , Processed in 0.077651 second(s), 27 queries .