This is a creation in
Article, where the information may have evolved or changed.
2013-10-27
Go Manual memory allocation
Go Manual memory allocation
When using go, sometimes you want to manage the memory yourself. So decide to write a manual memory management package. Just be bored practicing practiced hand ...
Overall design
Level two allocation. Larger memory is allocated in pages, 4k per page. The allocated chunk of memory can only be 1 pages, 2
consumed by a process was the total of everything that's in the process memory map. This includes data (eg, the Java heap), but also all of the GKFX libraries and memory-mapped files used by the program. On Linux, you can use the PMAP command to see all of the the things mapped into the process space (from this on off I ' M only g Oing to refer to Linux, because it's what I use; I ' m sure there is equivalent tools for Windows). Here's a excerpt from the memory map of the "Hello World" program;
produce a certain number of Inode and the Block2 Inode is the cable The function is to store the attribute information of the file and the index as the file.3 Ext3/ext4 The file system block holds the actual contents of the file.4 Inode is a piece of storage space, C6 non-boot partition inode default size 256,c5 is 128 bytes5inode is a string of numbers, different files corresponding to the Inode (a string of numbers) is unique in the file system6 Inode the same files, each other as hard connec
Linux operations-aware performance monitoring and debugging tools1 NagiosNagios is an open source monitoring solution, and I think he can monitor everything, and can look at my previous article: NAGIOS2 PS #用来查看程序的运行情况Ps-ef |grep svr.py|grep-v grep |awk ' {print $} ' #查看svr. PY process PID Number145543 free# View the system's physical (RAM) and swapped memory information [emailprotected]:~> free-mto #MB值显示, showing total total used free shared buffers cachedmem:3196 2947 249 0 1436swap:2053 196
-may-2010) inodesize: 256[[emailprotected]~]#dumpe2fs/dev/sda1|grep-i "Inode size "dumpe2fs1.41.12 (17-may-2010) inodesize: 128[[emailprotected]~]#df-hFilesystem SizeUsedAvailUse%Mountedon/dev/sda3 9.2G5.0G3.7G58%/tmpfs 242m0242m0% /dev/shm/dev/sda1194m29m155m 16%/bootMy system is CentOS 6.5, as you can see, the default inode size for the/boot partition is still 128, and the root partition (regular partition) is 256.4. Size of blockIn ext3 or EXT4 file systems, the block size is generally 1k,2k
. The virtual address returned by the function is contiguous (in fact this is also questionable.) Since the virtual address area of the above Vmalloc has a 4k cut address, it is assumed that the virtual address assigned by Vmalloc is very large. So is there a 4kb cutting address in the middle? ), there is no guarantee that the mapped physical address is contiguous.It mainly on the above Vmalloc_start to vmalloc_end this memory operation, the return of
The following content reproduced from: http://forum.ubuntu.org.cn/viewtopic.php?t=27451
The idea of defragmentation is mainly among two types of friends, one is the friend affected by Windows, and the other is a friend who has a certain degree of understanding of the principles of the operating system.Let me briefly explain some of the issues here.All operating systems generate disk fragmentation, which is why some friends have doubts. This fragment is called an internal fragment in the officia
a file is large, it may occupy multiple blocks, if a file is small, at least one, and the remaining space wasted;
(7) The same documents for the Inode, each hard linked file;
(8) A file is created to occupy at least one inode and one block;
(9) If the file is small, it must occupy at least one block and the remaining space can not be used;
(a) Inode size and total view:
Dumpe2fs/dev/sda2|egrep-i "Block size| Inode Size "
Dumpe2fs/dev/sda3|egrep-i "Block count| Inode Count "
(11) View the total
so on.
4K Display
The ipad Pro uses the same approach when it comes to hardware updates for previous generations of ipads. Apple is expected to be equipped with an oversized display, according to TechRadar News that the IPad Pro not only uses a 12.9-inch screen, the resolution also uses two versions, including 2048x1536 pixels and 4096x3072 pixels, the latter apparently reached the 4K standard. However
Nginx has gzip module http://wiki.nginx.org/NginxChsHttpGzipModule, this module supports the online real-time compression of output data streams. After good configuration optimization, can greatly improve the efficiency of the site's output.
__ Use Example __
Copy Code code as follows:
gzip on;
Gzip_min_length 1000;
Gzip_proxied expired No-cache No-store private auth;
Gzip_types Text/plain Application/xml;
Built-in variable $gzip _ratio can get to the gzip compressio
In the Linux Environment Performance optimization practice, Hugepage is a frequently mentioned method. Simply put, Hugepage is a way of using memory blocks on the Linux kernel. As an alternative to the traditional 4K page, Hugepage can improve the performance efficiency of Oracle instances in most scenarios.
First, Hugepage Introduction
Hugepage is widely enabled to start with Kernal 2.6, and some versions of the 2.4 kernel can also be used. In the
.
Worker_connections 204800;
Maximum number of connections for no worker process. According to the hardware adjustment, and the previous work process together to use, as large as possible, but do not run the CPU to 100% on the line. The maximum number of connections allowed per process, theoretically each Nginx server has the largest number of connections. Worker_processes*worker_connections
Keepalive_timeout 60;
KeepAlive timeout time.
Client_header_buffer_size
page size of 8KB.You can extend the buffer pool through the EXTENDED STORAGE option in the CREATE bufferpool statement. Extended Storage (ESTORE) acts as a secondary cache of pages that are evicted from the buffer pool, which can reduce I/O. The size of the ESTORE is controlled by the two database configuration parameters Num_estore_segs and ESTORE_SEG_SZ. If you use ESTORE, you will need to take out a certain amount of memory from the database shared memory to manage ESTORE, which means less m
.
be pre-allocated;
Ease of management
It is best to have little tuning or even need
OK, but some tuning is needed (for example, Extentsize prefetchsize
It is best to have little tuning or even need
Performance
Very good
Preferably, 5% to 10% more revenue can be obtained by using the original container
Preferably, however, you can not use the original container
Maximum table space size
64GB (
. Consider if a user can belong to more than one user group at a time? If so, how do you add a user to another group? How do I join multiple groups at once?Can belong to multiple user groups at the same time, usermod-g GROUP1,GROUP2,GROUP3 usernameSixth chapter1. Please check the information to understand these terms:/dev/hda,/dev/hdb,/DEV/SDA,/dev/sdb, what is the difference between them?/dev/hda,/dev/hdb is a block file for the IDE interface hard disk. /dev/hda represents the first IDE disk, a
hack_pthread_create hack_pthread_create.cWe can use the command strace to track the thread's creation process:$strace ./hack_pthread_createThe output of the relevant part of the interface pthread_create is as follows :Mmap (NULL, 8392704, prot_read| Prot_write, map_private| map_anonymous| Map_stack,-1, 0) = 0x7f70b6c2f000brk (0) = 0x1fe3000brk (0x2004000) = 0x2004000mprotect (0x7f70b6c2f000, 4096, Prot_none) = 0clone (child_stack=0x7f70
file.F-Normal file.9. Search by File Size:-size [+/-]100[c/k/m/g]: Represents a file with a length equal to [greater than/less than] 100 blocks [byte/k/m/g].-empty: Find empty files.Find. -size +4k-exec ls-l {} \; #查找文件大小大于4k的文件, print out the details of the found file at the same timeFind. -size-4k-exec ls-l {} \; #查找文件大小小于
. Finally, with a hybrid design pc, you can still have a full version of the system as it is now.
2. Solve screen resolution scaling problem
In 2014, PCs with 2K-resolution screens had become mainstream, while manufacturers such as Dell and Asus had launched 4K displays, and Lenovo and Toshiba were also planning to launch 4K-resolution laptops. Although the precision of the
This experience is CentOSrelease6.7 (Final), such as the lack of knowledge welcome criticism.Knowledge about the Inode and block of Linux:1> Linux system partition format file system, the system will be divided into inode and block two parts:1) The inode is the system file's attribute information (the result of ls-l) and pointer to the file entity, but does not store the file name, usually in the upper directory block.2) block for storing data, EXT3/EXT4 General is 1k,2k,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.