ram

Sorting 1 million 8-digit numbers in 1 MB of RAM

霸气de小男生 提交于 2019-11-29 18:30:33
I have a computer with 1 MB of RAM and no other local storage. I must use it to accept 1 million 8-digit decimal numbers over a TCP connection, sort them, and then send the sorted list out over another TCP connection. The list of numbers may contain duplicates, which I must not discard. The code will be placed in ROM, so I need not subtract the size of my code from the 1 MB. I already have code to drive the Ethernet port and handle TCP/IP connections, and it requires 2 KB for its state data, including a 1 KB buffer via which the code will read and write data. Is there a solution to this

Linux必知必会--vmstat

给你一囗甜甜゛ 提交于 2019-11-29 17:36:02
视野、格局、胸怀、魄力           ---无 参考资料: https://man.linuxde.net/vmstat       http://www.ha97.com/4512.html vmstat命令的含义为显示虚拟内存,它可报告关于进程、内存、I/0等系统整体运行状态。 语法 vmstat 选项 参数 参数: 事件间隔:状态信息刷新的时间间隔 次数:显示报告的次数 示例: vmstat 1 每隔1s输出一次 vmstat 1 5 每个1s输出一次,一共输出5次 字段说明 procs: r:运行队列中进程数量,这个值也可以判断是否需要增加CPU b:等待I/O的数量 Memory: swpd:使用虚拟内存的大小,如果swpd的值不为0.但是SI、SO的值增长期为0.这种情况不会影响系统性能。 free:空闲物理内存大小 buff:用作缓冲的内存大小 cache:用作缓存的内存大小,如果cache的值大时,说明cache处的文件数多,如果频繁访问到的文件都能被cache处,那么磁盘的读IO、bi会非常小 swap: si:每秒从交换写到内存的大小,由磁盘调入内存 so:每秒写入交换区的内存大小,由内存调入磁盘 注:内存够用的时候,这2个值都是0,如果这2个值长期大于0的时候,系统性能会受到影响,磁盘IO和CPU资源都会被消耗。有些朋友看到空闲内存(free

深度学习小白装机-记录一下

佐手、 提交于 2019-11-29 17:08:55
深度学习小白装机-记录一下 三个备选清单。 原本早就有攒一部机器的想法,最近刚刚好在玩深度学习的小案例,所以产生了装一部自己的台式机的想法。 下面均是自己查资料所得,可能与实际有差入。出错了,我也不负责呀,哈哈。关于价格,我是根据某东自营店价格(截至2019-09)来做比较的,可能不同时间段有差入,价格因素需要自己衡量高低。 我根据不同的价格成本和预设的使用场景设计了三个不同的方案。 先说结论,我最终选择的清单3 学生党版。配置是i5-9600kf+gtx1660ti 。这个清单上GTX 1660ti的显存是6G,cuda核心是1536个,显存频率为9000MHz,显存位宽192bit,这个性能用于应对Kaggle等上中小型数据集的比赛应该是比较足够的。 清单1 工作站版 考虑可以扩展4 GPU 的工作站级别 这里包括预留的电源功率空间和CPU频率最多可以挂载2 CPU。 虽然这个主板属于服务器主板,可以挂载4 GPU,但是不建议自己搭建负载4 GPU的工作站。因为工作站成本本来就高,例如配置目前来说顶级的显卡RTX2080ti,价格会高达1.3w块左右(截至2019-09),光显卡成本就高达5.2w了。搭配CPU等其他配件时,成本会更高。建议有这个资金,不妨请专业的厂家去定制,保修包括购买配件都比较更方便些。 部件 型号 购买网址 价格 GPU选择 ZOTAC 索泰

Store/retrieve a data structure

给你一囗甜甜゛ 提交于 2019-11-29 13:36:06
问题 I have implemented a suffix tree in Python to make full-text-searchs, and it's working really well. But there's a problem: the indexed text can be very big, so we won't be able to have the whole structure in RAM. IMAGE: Suffix tree for the word BANANAS (in my scenario, imagine a tree 100000 times bigger). So, researching a little bit about it I found the pickle module, a great Python module for "loading" and "dumping" objects from/into files, and guess what? It works wonderfully with my data

Dynamic memory allocation in embedded C

谁说我不能喝 提交于 2019-11-29 13:02:12
Can I use functions malloc and delete in embedded C? For example, I have one function, where was created pointer on structure with function malloc. This function return address in ram and I can use this . After exit from my function, where memory was allocated, this pointer will be deleted or this memory reserved for this, while not will be function delete terminated ? Typedef struct { Char varA; Char varB } myStruct ; Void myfunc ( void) { myStruct * ptrStruct = ( myStruct *) malloc ( sizeof (myStruct)) ; // Code here //........ return ; } Yes, you can use malloc in embedded C. Some embedded

读写储存器RAM IP核的调取及应用

白昼怎懂夜的黑 提交于 2019-11-29 12:26:51
写在前面的话 在很多时候 , 我们需要将采集得到的数据先存储起来 ,等到了需要的时候再调用。如果是这种情况,那么就要求我们的存储器必须可读可写。本节,梦翼师兄就和大家一起学习 FPGA 可读写存储器 IP 核 -RAM 的使用。 项目 需求 设计一个 RAM 控制器,该控制器负责对 RAM 进行读写操作,首先将数据写入 RAM ,然后再将数据全部读出。如果读出的数据和写入的数据完全一致,说明我们的操作和设计正确。 操作步骤 在右侧的 IP 核搜索区,输入 ram ,在菜单栏找到并双击【 RAM : 1-PORT 】 选择语言类型为 Verilog ,并命名,点击【 OK 】 设置 ram 的存储深度和每一个存储空间的比特位数,然后点击【 NEXT 】 把 【q output port】 前面的对钩取消掉(如果不取消掉就会在输出端口生成寄存器,输出就会慢一拍,这里我们不需要它慢一拍),然后点击 【NEXT】 一直点击【 NEXT 】,直到如下界面,选择 my_ram_inst.v ,点击【 Finish 】,完成对 ram 的设置 顶层架构设计 RAM 是可读写的存储器,我们用一个控制模块 向ram 中写入数据,然后读出。 模块功能介绍 模块名 功能描述 Ram_control Ram控制器,对my_ram进行读写 My_ram ram存储器IP核 ram 系统顶层模块

what's the difference between working set and commit size?

我的未来我决定 提交于 2019-11-29 09:03:39
when debugging OOM bugs, what's the difference between working set and commit size? Especially what's the exact meaning for commit size? CodeNaked From here , the working set is: ... a count of physical memory (RAM) rather than virtual address space. It represents the subset of the process's virtual address space that is valid, meaning that it can be referenced without incurring a page fault. The commit size is: the total amount of pageable virtual address space for which no backing store is assigned other than the pagefile. On systems with a pagefile, it may be thought of as the maximum

Why is Pandas Concatenation (pandas.concat) so Memory Inefficient?

寵の児 提交于 2019-11-29 06:07:14
问题 I have about 30 GB of data (in a list of about 900 dataframes) that I am attempting to concatenate together. The machine I am working with is a moderately powerful Linux Box with about 256 GB of ram. However, when I try to concatenate my files I quickly run out of available ram. I have tried all sorts of workarounds to fix this (concatenating in smaller batches with for loops, etc.) but I still cannot get these to concatenate. Two questions spring to mind: Has anyone else dealt with this and

How to check the amount of RAM in R

穿精又带淫゛_ 提交于 2019-11-29 02:49:31
I want to make a function that imports data in different numbers of batches depending on how much RAM is available on someones system. But how can I find the amount of available RAM in R? I can use memory.size() but that only works for Windows. Given the warnings concerning platform-dependency discussed in the earlier comment, you could for example parse /proc/meminfo on Linux: $ grep MemFree /proc/meminfo MemFree: 573660 kB $ awk '/MemFree/ {print $2}' /proc/meminfo 565464 You could try the second approach via system(..., intern=TRUE) , or even via a pipe connection. Edit some 5+ years later:

ROM、RAM、FLASH的区别

这一生的挚爱 提交于 2019-11-28 20:59:05
初学MCU的人,经常会看到ROM, RAM, FLASH,而且会被这些词汇搞得晕头转向。本文对这些概念进行了厘清,并介绍了这些Memory的区别,以及它们在MCU中的作用。 ROM (Read Only Memory)程序存储器 ROM全称Read Only Memory,顾名思义,它是一种只能读出事先所存的数据的固态半导体存储器。ROM中所存数据稳定,一旦存储数据就再也无法将之改变或者删除,断电后所存数据也不会消失。其结构简单,因而常用于存储各种固化程序和数据。 在单片机中用来存储程序数据及常量数据或变量数据,凡是c文件及h文件中所有代码、全局变量、局部变量、‘const’限定符定义的常量数据、startup.asm文件中的代码(类似ARM中的bootloader或者X86中的BIOS,一些低端的单片机是没有这个的)通通都存储在ROM中。 为了便于使用和大批量生产,进一步发展出了可编程只读存储器(PROM)、可擦除可编程只读存储器(EPROM)。EPROM需要用紫外线长时间照射才能擦除,使用很不方便。1980s又出现了电可擦除可编程只读存储器(EEPROM),它克服了EPROM的不足,但是集成度不高、价格较贵。于是又发展出了一种新型的存储单元结构同EPROM类似的快闪存储器(FLASH MEMORY)。FLASH集成度高、功耗低、体积小,又能在线快速擦除,因而获得了快速发展。