memory

What are pinned objects?

时光毁灭记忆、已成空白 提交于 2020-03-30 04:37:11
问题 I am trying to find a memory leak using ants memory profiler, and I've encountered in a new term: Pinned objects. Can some one give me a good & simple explanation about what this objects are, How can I pinn/Unpinn objects, and detect who pinned objects? Thanks 回答1: A pinned object is one that is not allowed to move. The garbage collector is normally compacting the memory in that it moves all objects to "one or more clusters". This is to create large chunks of free space. This basically means

Redis监控方案

 ̄綄美尐妖づ 提交于 2020-03-29 05:25:06
Redis介绍 Redis是一种高级key-value数据库。它跟memcached类似,不过数据可以持久化,而且支持的数据类型很丰富。有字符串,链表、哈希、集合和有序集合5种。支持在服务器端计算集合的并、交和补集(difference)等,还支持多种排序功能。所以Redis也可以被看成是一个数据结构服务器。Redis的所有数据都是保存在内存中,然后不定期的通过异步方式保存到磁盘上(这称为“半持久化模式”);也可以把每一次数据变化都写入到一个append only file(aof)里面(这称为“全持久化模式”)。 Redis监控 首先判断客户端和服务器 连接是否正常 ? 1 2 3 4 5 6 7 # 客户端和服务器连接正常,返回PONG redis> PING PONG # 客户端和服务器连接不正常(网络不正常或服务器未能正常运行),返回连接异常 redis 127.0 . 0.1: 6379 > PING Could not connect to Redis at 127.0 . 0.1: 6379: Connection refused Redis 监控最直接的方法就是使用系统提供的 info 命令,只需要执行下面一条命令,就能获得 Redis 系统的状态报告。 ? 1 redis-cli info 结果会返回 Server、Clients、Memory

Windows Embedded CE 6.0 Internals (2) Memory

不想你离开。 提交于 2020-03-29 03:35:52
这篇文章是继文章 Windows Embedded CE 6.0 Internals (1) 的。内存这块一直是让人头痛的东西,因为比较复杂,但是我们却需要经常与其打交道——内存泄漏、异常定位、程序优化等等。这篇文章以及后续的文章我试着能够刨根问底。 5.内存构架 内存的种类 1.Random Access Memory (RAM) Random access memory can be read or written directly at any address . There are various types of RAM that are differentiated by the underlying hardware technology used to implement them. However they all share the ability to be read or written directly at any random address. RAM memory is volatile, the contents are only maintained as long as power is not lost. 2.Read Only Memory (ROM) Read Only Memory typically refers to memory

/proc/meminfo分析(一)

落花浮王杯 提交于 2020-03-28 20:06:02
本文主要分析/proc/meminfo文件的各种输出信息的具体含义。 一、MemTotal MemTotal对应当前系统中可以使用的物理内存。 这个域实际是对应内核中的totalram_pages这个全局变量的,定义如下: unsigned long totalram_pages __read_mostly; 该变量表示当前系统中Linux内核可以管理的所有的page frame的数量。注意:这个值并不是系统配置的内存总数,而是指操作系统可以管理的内存总数。 内核是如何得到totalram_pages这个值的呢?是在初始化的过程中得到的,具体如下:我们知道,在内核初始化的时候,我们可以通过memblock模块来管理内存布局,从而得到了memory type和reserved type的内存列表信息。在初始化阶段如果有内存分配的需求,那么也可以通过memblock来完成,直到伙伴系统初始化完成,而在这个过程中,memory type的那些page frame被一个个的注入到各个zone的free list中,同时用totalram_pages 来记录那个时间点中空闲的page frame数量。这个点也就是伙伴系统的一个初始内存数量的起点。 举一个实际的例子:我的T450的计算机,配置的内存是8G,也就是8388608KB。但是MemTotal没有那么多,毕竟OS本身(正文段

Linux cat /proc/meminfo 输出分析

此生再无相见时 提交于 2020-03-28 20:03:21
$cat /proc/meminfo MemTotal:   2052440 kB //总内存 MemFree:  50004 kB //空闲内存 Buffers:   19976 kB //给文件的缓冲大小 Cached:   436412 kB //高速缓冲存储器(http://baike.baidu.com/view/496990.htm)使用的大小 SwapCached: 19864 kB //被高速缓冲存储用的交换空间大小 Active:    1144512 kB //活跃使用中的高速缓冲存储器页面文件大小 Inactive:    732788 kB //不经常使用的高速缓冲存储器页面文件大小 Active(anon): 987640 kB //anon:不久 Inactive(anon): 572512 kB Active(file): 156872 kB Inactive(file): 160276 kB Unevictable: 8 kB Mlocked: 8 kB HighTotal: 1177160 kB //The total and free amount of memory, in kilobytes, that is not directly mapped into kernel space. HighFree: 7396 kB // The

MIT6.828 Fall2018 笔记 - Lab 2: Memory Management

浪子不回头ぞ 提交于 2020-03-28 00:38:47
Lab 2: Memory Management 建议先看完xv6book的Chapter1和Chapter2 Introduction Memory management有两部分:physical memory allocator for the kernel和virtual memory。 The x86 hardware's memory management unit (MMU) performs the mapping when instructions use memory, consulting a set of page tables. Getting started git pull git checkout -b lab2 origin/lab2 git merge lab1 # 如果有冲突就处理一下 # git add . # git commit memlayout.h 描述了virtual address space的布局,你需要通过修改 pmap.c 来实现virtual address space。你会使用 PageInfo 结构体来跟踪空闲的和已经被分配的physical memory page。 kclock.c 和 kclock.h 控制电池供电时钟和CMOS RAM硬件。BIOS记录了PC包含的物理内存量。 pmap.c

非易失性WAL buffer

与世无争的帅哥 提交于 2020-03-27 23:20:03
今天看到PG邮件列表里有非易失性内存在PG应用的讨论,做下记录,接着学习其补丁,如何将WAL buffer改造成非易失性buffer,以及和之前有和区别。该补丁是也是日本NTT公司提供。 一、原文 https://www.postgresql.org/message-id/002f01d5d28d$23c01430$6b403c90$@hco.ntt.co.jp_1 二、Non-volatile WAL BUFFER 提出了一个概念证明的新特性:“非易失WAL buffer”。通过将非易失内存(PMEM)替代DRAM,不需要将WAL记录写入WAL段文件即可将其持久化。减少了WAL拷贝和write事务的时间,从而提升数据库性能。 完成此功能的补丁基于PG12(refs/tags/REL_12_0),附在后文。阅读README.nvwal(patch 0003)了解如何使用该特性。 PMEM[1]可插到DIMM槽,具有快速、非易失、字节寻址的特性。已生产有该特性的产品。NVDIMM-N是PMEM模块的一种,包含DRAM和NAND flash,可以像访问DRAM一样访问NVDIMM-N。断点时,将内容写到flash域。加电重启时将flash内容重新拷贝回去即DRAM。大多数操作系统linux和windows都支持PMEM和持久内存开发集(PMDK)[2]

StringRedisTemplate获取redis信息

徘徊边缘 提交于 2020-03-26 11:04:35
StringRedisTemplate获取redis信息 Properties info = redisTemplate.getRequiredConnectionFactory().getConnection().info("memory"); 可选参数: server :有关Redis服务器的常规信息 clients :客户端连接部分 memory :内存消耗相关信息 persistence :RDB和AOF相关信息 stats :一般统计 replication :主/副本复制信息 cpu :CPU消耗统计信息 commandstats :Redis命令统计 cluster :“ Redis群集”部分 keyspace :与数据库相关的统计 它还可以采用以下值: all :返回所有部分 default :仅返回默认的部分集 如果未提供任何参数,则采用该 default 选项。 返回值: redis> INFO # Server # Redis服务器版本 redis_version:999.999.999 redis_git_sha1:3c968ff0 redis_git_dirty:0 redis_build_id:51089de051945df4 redis_mode:standalone # Redis 服务器的宿主操作系统 os:Linux 4.8.0-1-amd64

gsoap response memory allocation nested structure

杀马特。学长 韩版系。学妹 提交于 2020-03-25 21:51:47
问题 Im trying to find the right way of allocation memory for the following structure. struct part1 { char* c1; char* c2; } struct part2 { int a; struct part1 *local; } struct response { struct part1* p1; struct part2* p2; } This is what I do, as gathered from the documents. int myservice ( soap *soap, struct request *request, struct response *resp) { ... // top level resp is setup by soap_serve resp->p1 = soap_new_ns__part1(soap,1); resp->p1->c1 = soap_new_string(soap,10); (also tried soap_malloc

jena处理Owl

耗尽温柔 提交于 2020-03-24 12:44:54
创建Owl模型,参数可以制定那种形式的推理机,比如owl dl: OntModel m=ModelFactory.createOntologyModel(); OntModel m=ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM); OntModelSpec Language profile Storage model Reasoner OWL_MEM OWL full in-memory none OWL_MEM_TRANS_INF OWL full in-memory transitive class-hierarchy inference OWL_MEM_RULE_INF OWL full in-memory rule-based reasoner with OWL rules OWL_MEM_MICRO_RULE_INF OWL full in-memory optimised rule-based reasoner with OWL rules OWL_MEM_MINI_RULE_INF OWL full in-memory rule-based reasoner with subset of OWL rules OWL_DL_MEM OWL DL in-memory none OWL_DL_MEM