Home Backend Development PHP Tutorial Nginx memory management

Nginx memory management

Jul 30, 2016 pm 01:31 PM
log nbsp pool size

1. Source code location

Header file: http://trac.nginx.org/nginx/browser/nginx/src/core/ngx_palloc.h

Source file: http://trac.nginx.org/ nginx/browser/nginx/src/core/ngx_palloc.c

2. Data structure definition

Let’s first learn about several main data structures of nginx memory pool:

ngx_pool_data_t (memory pool data block structure)

<span> 1:</span><span>typedef</span> <span>struct</span> {<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 2:</span>     u_char               *last;        <precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 3:</span>     u_char               *end;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 4:</span>     ngx_pool_t           *next;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 5:</span>     ngx_uint_t            failed;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 6:</span> } ngx_pool_data_t;<ul> <li>last: It is an unsigned char type pointer, which saves the last address allocated to the current memory pool, that is, the next allocation starts here. </li> <li>end: The end position of the memory pool; </li> <li>next: There are many blocks of memory in the memory pool. These memory blocks are connected into a linked list through this pointer, and next points to the next block of memory. </li> <li>failed: The number of memory pool allocation failures. </li> </ul><blockquote><p>ngx_pool_s (memory pool header structure) </p></blockquote><divcourier new width:950px color:black padding:0px direction:ltr line-height:12pt background-color:rgb><precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 1:</span><span>struct</span> ngx_pool_s {<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 2:</span>     ngx_pool_data_t       d;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 3:</span>     size_t                max;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 4:</span>     ngx_pool_t           *current;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 5:</span>     ngx_chain_t          *chain;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 6:</span>     ngx_pool_large_t     *large;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 7:</span>     ngx_pool_cleanup_t   *cleanup;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 8:</span>     ngx_log_t            *log;<precourier new width:950px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 9:</span> };<ul> <li>d: the data block of the memory pool; </li> <li>max: the maximum value of the memory pool data block; </li> <li>current: points to the current memory pool; </li> <li> chain: This pointer is attached to an ngx_chain_t structure; </li> <li>large: a large memory linked list, which is used when the allocated space exceeds max; </li> <li>cleanup: callback to release the memory pool </li> <li>log: log information </li> </ul><p> is composed of ngx_pool_data_t and ngx_pool_t The composed nginx memory pool structure is shown in the figure below: </p><p><img src="/static/imghw/default1.png" data-src="http://image.codes51.com/Article/image/20150814/20150814194335_5243.jpg" class="lazy" style="max-width:90%" style="max-width:90%" alt="Nginx memory management" ></p><p> 3. Introduction to related functions </p><blockquote> <p> Before analyzing the memory pool method, we need to introduce several main memory-related functions: </p> <p>ngx_alloc: (just对malloc进行了简单的封装)</p> <p><divcourier new width:870px color:black padding:0px direction:ltr line-height:12pt background-color:rgb><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 1:</span><span>void</span> *<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 2:</span> ngx_alloc(size_t size, ngx_log_t *log)<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 3:</span> {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 4:</span>     <span>void</span>  *p;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 5:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 6:</span>     p = malloc(size);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 7:</span>     <span>if</span> (p == NULL) {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 8:</span>         ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 9:</span>                       <span>"malloc(%uz) failed"</span>, size);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 10:</span>     }<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 11:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 12:</span>     ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, <span>"malloc: %p:%uz"</span>, p, size);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 13:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 14:</span>     <span>return</span> p;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 15:</span> }</precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></divcourier></p> </blockquote><blockquote><p>ngx_calloc:(调用malloc并初始化为0)</p></blockquote><blockquote><p><divcourier new width:870px color:black padding:0px direction:ltr line-height:12pt background-color:rgb><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 1:</span><span>void</span> *<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 2:</span> ngx_calloc(size_t size, ngx_log_t *log)<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 3:</span> {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 4:</span>     <span>void</span>  *p;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 5:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 6:</span>     p = ngx_alloc(size, log);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 7:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 8:</span>     <span>if</span> (p) {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 9:</span>         ngx_memzero(p, size);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 10:</span>     }<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 11:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 12:</span>     <span>return</span> p;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 13:</span> }</precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></divcourier></p></blockquote><blockquote> <p>ngx_memzero:</p> <p><divcourier new width:870px color:black padding:0px direction:ltr line-height:12pt background-color:rgb><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 1:</span> #define ngx_memzero(buf, n)       (<span>void</span>) memset(buf, 0, n)</precourier></divcourier></p> </blockquote><blockquote> <p>ngx_free :</p> <p><divcourier new width:870px color:black padding:0px direction:ltr line-height:12pt background-color:rgb><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 1:</span> #define ngx_free          free</precourier></divcourier></p> </blockquote><blockquote> <p>ngx_memalign: </p> <p><divcourier new width:870px color:black padding:0px direction:ltr line-height:12pt background-color:rgb></divcourier></p> <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 1:</span><span>void</span> *<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 2:</span> ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 3:</span> {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 4:</span>     <span>void</span>  *p;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 5:</span>     <span>int</span>    err;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 6:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 7:</span>     err = posix_memalign(&p, alignment, size);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 8:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 9:</span>     <span>if</span> (err) {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 10:</span>         ngx_log_error(NGX_LOG_EMERG, log, err,<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 11:</span>                       <span>"posix_memalign(%uz, %uz) failed"</span>, alignment, size);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 12:</span>         p = NULL;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 13:</span>     }<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 14:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 15:</span>     ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0,<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 16:</span>                    <span>"posix_memalign: %p:%uz @%uz"</span>, p, size, alignment);rrree</precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier></precourier> </blockquote> <limicrosoft yahei font-size:15px line-height:35px><blockquote> <em>The alignment here is mainly for some unix platforms that require dynamic alignment. It encapsulates posix_memalign() provided by POSIX 1003.1d. In most cases, In this case, the compiler and C library transparently handle the alignment problem for you. nginx is controlled through the macro NGX_HAVE_POSIX_MEMALIGN; calling </em>posix_memalign( )<em> successfully will return </em>size<em>bytes of dynamic memory, and the address of this memory is a multiple of </em>alignment<em>. The parameter </em>alignment<em> must be a power of 2, or a multiple of the size of the </em>void<em> pointer. The address of the returned memory block is placed in </em>memptr<em>, and the function return value is </em>0</blockquote>.<limicrosoft yahei font-size:15px line-height:35px><blockquote></blockquote> <p></p>4. Basic operations of the memory pool🎜<ul><li>The main external methods of the memory pool are: </li></ul> <limicrosoft yahei font-size:15px line-height:35px><table cellspacing="0" cellpadding="2" border="1"><tbody> <tr> <td valign="top" width="118">Create a memory pool</td> <td valign="top" width="768">ngx_pool_t * ngx_create_pool(size_t size, ngx_log_t *log);</td> </tr> <tr> <td valign="top" width="118">Destroy the memory pool</td> <td valign="top" width="768">vo id ngx_destroy_pool(ngx_pool_t *pool ; ( Not aligned)</td> </tr>void * ngx_pnalloc(ngx_pool_t *pool, size_t size);<tr> <td valign="top" width="118"></td> <td valign="top" width="768">Memory clearing</td> </tr>ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p);<tr> <td valign="top" width="118"></td> <td valign="top" width="768"><limicrosoft yahei font-size:15px line-height:35px><limicrosoft yahei font-size:15px line-height:35px><p>4.1 创建内存池ngx_create_pool</p> <blockquote><p>ngx_create_pool用于创建一个内存池,我们创建时,传入我们的需要的初始大小:</p></blockquote> <limicrosoft yahei font-size:15px line-height:35px><blockquote><p><divcourier new width:870px color:black padding:0px direction:ltr line-height:12pt background-color:rgb><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 1:</span> ngx_pool_t *<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 2:</span> ngx_create_pool(size_t size, ngx_log_t *log)<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 3:</span> {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 4:</span>     ngx_pool_t  *p;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 5:</span>     <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 6:</span>     <span>//以16(NGX_POOL_ALIGNMENT)字节对齐分配size内存</span><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 7:</span>     p = ngx_memalign(NGX_POOL_ALIGNMENT, size, log);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 8:</span>     <span>if</span> (p == NULL) {<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 9:</span>         <span>return</span> NULL;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 10:</span>     }<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 11:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 12:</span>     <span>//初始状态:last指向ngx_pool_t结构体之后数据取起始位置</span><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 13:</span>     p->d.last = (u_char *) p + <span>sizeof</span>(ngx_pool_t);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 14:</span>     <span>//end指向分配的整个size大小的内存的末尾</span><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 15:</span>     p->d.end = (u_char *) p + size;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 16:</span>     <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 17:</span>     p->d.next = NULL;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 18:</span>     p->d.failed = 0;<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 19:</span>  <precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 20:</span>     size = size - <span>sizeof</span>(ngx_pool_t);<precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 21:</span>     <span>//#define NGX_MAX_ALLOC_FROM_POOL  (ngx_pagesize - 1),内存池最大不超过4095,x86中页的大小为4K</span><precourier new width:870px padding:0px direction:ltr margin:0em line-height:12pt background-color:rgb><span> 22:</span>     p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;
Copy after login
<span> 23:</span>
Copy after login
24: p->current = p; 25:     p->chain = NULL; 26:     p->large = NULL; 27:     p->cleanup = NULL; 28:     p->log = log; 29:  30:     return p; 31: }

nginx对内存的管理分为大内存与小内存,当某一个申请的内存大于某一个值时,就需要从大内存中分配空间,否则从小内存中分配空间。

nginx中的内存池是在创建的时候就设定好了大小,在以后分配小块内存的时候,如果内存不够,则是重新创建一块内存串到内存池中,而不是将原有的内存池进行扩张。当要分配大块内存是,则是在内存池外面再分配空间进行管理的,称为大块内存池。

 

4.2 内存申请 ngx_palloc

1:void * 2: ngx_palloc(ngx_pool_t *pool, size_t size) 3: { 4:     u_char      *m; 5:     ngx_pool_t  *p; 6:  7:     //如果申请的内存大小小于内存池的max值 8:     if (size <= pool->max) { 9:  10:         p = pool->current; 11:  12:         do { 13:             //对内存地址进行对齐处理 14:             m = ngx_align_ptr(p->d.last, NGX_ALIGNMENT); 15:  16:             //如果当前内存块够分配内存,则直接分配 17:             if ((size_t) (p->d.end - m) >= size) 18:             { 19:                 p->d.last = m + size; 20:  21:                 return m; 22:             } 23:             24:             //如果当前内存块有效容量不够分配,则移动到下一个内存块进行分配 25:             p = p->d.next; 26:  27:         } while (p); 28:  29:         //当前所有内存块都没有空闲了,开辟一块新的内存,如下2详细解释 30:         return ngx_palloc_block(pool, size); 31:     } 32:  33:     //分配大块内存 34:     return ngx_palloc_large(pool, size); 35: }

需要说明的几点:

1、ngx_align_ptr,这是一个用来内存地址取整的宏,非常精巧,一句话就搞定了。作用不言而喻,取整可以降低CPU读取内存的次数,提高性能。因为这里并没有真正意义调用malloc等函数申请内存,而是移动指针标记而已,所以内存对齐的活,C编译器帮不了你了,得自己动手。

1: #define ngx_align_ptr(p, a)                                                   \ 2:      (u_char *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))

2、开辟一个新的内存块 ngx_palloc_block(ngx_pool_t *pool, size_t size)

这个函数是用来分配新的内存块,为pool内存池开辟一个新的内存块,并申请使用size大小的内存;

1:static void * 2: ngx_palloc_block(ngx_pool_t *pool, size_t size) 3: { 4:     u_char      *m; 5:     size_t       psize; 6:     ngx_pool_t  *p, *new; 7:  8:     //计算内存池第一个内存块的大小 9:     psize = (size_t) (pool->d.end - (u_char *) pool); 10:  11:     //分配和第一个内存块同样大小的内存块 12:     m = ngx_memalign(NGX_POOL_ALIGNMENT, psize, pool->log); 13:     if (m == NULL) { 14:         return NULL; 15:     } 16:  17:     new = (ngx_pool_t *) m; 18:  19:     //设置新内存块的end 20:     new->d.end = m + psize; 21:     new->d.next = NULL; 22:     new->d.failed = 0; 23:  24:     //将指针m移动到d后面的一个位置,作为起始位置 25:     m += sizeof(ngx_pool_data_t); 26:     //对m指针按4字节对齐处理 27:     m = ngx_align_ptr(m, NGX_ALIGNMENT); 28:     //设置新内存块的last,即申请使用size大小的内存 29:     new->d.last = m + size; 30:  31:     //这里的循环用来找最后一个链表节点,这里failed用来控制循环的长度,如果分配失败次数达到5次,就忽略,不需要每次都从头找起 32:     for (p = pool->current; p->d.next; p = p->d.next) { 33:         if (p->d.failed++ > 4) { 34:             pool->current = p->d.next; 35:         } 36:     } 37:  38:     p->d.next = new; 39:  40:     return m; 41: }

3、分配大块内存 ngx_palloc_large(ngx_pool_t *pool, size_t size)

在ngx_palloc中首先会判断申请的内存大小是否超过内存块的最大限值,如果超过,则直接调用ngx_palloc_large,进入大内存块的分配流程;

1:static void * 2: ngx_palloc_large(ngx_pool_t *pool, size_t size) 3: { 4:     void              *p; 5:     ngx_uint_t         n; 6:     ngx_pool_large_t  *large; 7:  8:     // 直接在系统堆中分配一块大小为size的空间 9:     p = ngx_alloc(size, pool->log); 10:     if (p == NULL) { 11:         return NULL; 12:     } 13:  14:     n = 0; 15:  16:     // 查找到一个空的large区,如果有,则将刚才分配的空间交由它管理  17:     for (large = pool->large; large; large = large->next) { 18:         if (large->alloc == NULL) { 19:             large->alloc = p; 20:             return p; 21:         } 22:         //为了提高效率, 如果在三次内没有找到空的large结构体,则创建一个 23:         if (n++ > 3) { 24:             break; 25:         } 26:     } 27:  28:  29:     large = ngx_palloc(pool, sizeof(ngx_pool_large_t)); 30:     if (large == NULL) { 31:         ngx_free(p); 32:         return NULL; 33:     } 34:     35:     //将large链接到内存池 36:     large->alloc = p; 37:     large->next = pool->large; 38:     pool->large = large; 39:  40:     return p; 41: }

整个内存池分配如下图:

Nginx memory management

  • 4.3 内存池重置 ngx_reset_pool

1:void 2: ngx_reset_pool(ngx_pool_t *pool) 3: { 4:     ngx_pool_t        *p; 5:     ngx_pool_large_t  *l; 6:     7:     //释放大块内存 8:     for (l = pool->large; l; l = l->next) { 9:         if (l->alloc) { 10:             ngx_free(l->alloc); 11:         } 12:     } 13:     14:     // 重置所有小块内存区 15:     for (p = pool; p; p = p->d.next) { 16:         p->d.last = (u_char *) p + sizeof(ngx_pool_t); 17:         p->d.failed = 0; 18:     } 19:  20:     pool->current = pool; 21:     pool->chain = NULL; 22:     pool->large = NULL; 23: }

4.4 内存池释放 ngx_pfree

1: ngx_int_t 2: ngx_pfree(ngx_pool_t *pool, void *p) 3: { 4:     ngx_pool_large_t  *l; 5:  6:     //只检查是否是大内存块,如果是大内存块则释放 7:     for (l = pool->large; l; l = l->next) { 8:         if (p == l->alloc) { 9:             ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0, 10:                            "free: %p", l->alloc); 11:             ngx_free(l->alloc); 12:             l->alloc = NULL; 13:  14:             return NGX_OK; 15:         } 16:     } 17: 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solution: Your organization requires you to change your PIN Solution: Your organization requires you to change your PIN Oct 04, 2023 pm 05:45 PM

The message "Your organization has asked you to change your PIN" will appear on the login screen. This happens when the PIN expiration limit is reached on a computer using organization-based account settings, where they have control over personal devices. However, if you set up Windows using a personal account, the error message should ideally not appear. Although this is not always the case. Most users who encounter errors report using their personal accounts. Why does my organization ask me to change my PIN on Windows 11? It's possible that your account is associated with an organization, and your primary approach should be to verify this. Contacting your domain administrator can help! Additionally, misconfigured local policy settings or incorrect registry keys can cause errors. Right now

How to adjust window border settings on Windows 11: Change color and size How to adjust window border settings on Windows 11: Change color and size Sep 22, 2023 am 11:37 AM

Windows 11 brings fresh and elegant design to the forefront; the modern interface allows you to personalize and change the finest details, such as window borders. In this guide, we'll discuss step-by-step instructions to help you create an environment that reflects your style in the Windows operating system. How to change window border settings? Press + to open the Settings app. WindowsI go to Personalization and click Color Settings. Color Change Window Borders Settings Window 11" Width="643" Height="500" > Find the Show accent color on title bar and window borders option, and toggle the switch next to it. To display accent colors on the Start menu and taskbar To display the theme color on the Start menu and taskbar, turn on Show theme on the Start menu and taskbar

How to change title bar color on Windows 11? How to change title bar color on Windows 11? Sep 14, 2023 pm 03:33 PM

By default, the title bar color on Windows 11 depends on the dark/light theme you choose. However, you can change it to any color you want. In this guide, we'll discuss step-by-step instructions for three ways to change it and personalize your desktop experience to make it visually appealing. Is it possible to change the title bar color of active and inactive windows? Yes, you can change the title bar color of active windows using the Settings app, or you can change the title bar color of inactive windows using Registry Editor. To learn these steps, go to the next section. How to change title bar color in Windows 11? 1. Using the Settings app press + to open the settings window. WindowsI go to "Personalization" and then

OOBELANGUAGE Error Problems in Windows 11/10 Repair OOBELANGUAGE Error Problems in Windows 11/10 Repair Jul 16, 2023 pm 03:29 PM

Do you see "A problem occurred" along with the "OOBELANGUAGE" statement on the Windows Installer page? The installation of Windows sometimes stops due to such errors. OOBE means out-of-the-box experience. As the error message indicates, this is an issue related to OOBE language selection. There is nothing to worry about, you can solve this problem with nifty registry editing from the OOBE screen itself. Quick Fix – 1. Click the “Retry” button at the bottom of the OOBE app. This will continue the process without further hiccups. 2. Use the power button to force shut down the system. After the system restarts, OOBE should continue. 3. Disconnect the system from the Internet. Complete all aspects of OOBE in offline mode

How to enable or disable taskbar thumbnail previews on Windows 11 How to enable or disable taskbar thumbnail previews on Windows 11 Sep 15, 2023 pm 03:57 PM

Taskbar thumbnails can be fun, but they can also be distracting or annoying. Considering how often you hover over this area, you may have inadvertently closed important windows a few times. Another disadvantage is that it uses more system resources, so if you've been looking for a way to be more resource efficient, we'll show you how to disable it. However, if your hardware specs can handle it and you like the preview, you can enable it. How to enable taskbar thumbnail preview in Windows 11? 1. Using the Settings app tap the key and click Settings. Windows click System and select About. Click Advanced system settings. Navigate to the Advanced tab and select Settings under Performance. Select "Visual Effects"

Display scaling guide on Windows 11 Display scaling guide on Windows 11 Sep 19, 2023 pm 06:45 PM

We all have different preferences when it comes to display scaling on Windows 11. Some people like big icons, some like small icons. However, we all agree that having the right scaling is important. Poor font scaling or over-scaling of images can be a real productivity killer when working, so you need to know how to customize it to get the most out of your system's capabilities. Advantages of Custom Zoom: This is a useful feature for people who have difficulty reading text on the screen. It helps you see more on the screen at one time. You can create custom extension profiles that apply only to certain monitors and applications. Can help improve the performance of low-end hardware. It gives you more control over what's on your screen. How to use Windows 11

10 Ways to Adjust Brightness on Windows 11 10 Ways to Adjust Brightness on Windows 11 Dec 18, 2023 pm 02:21 PM

Screen brightness is an integral part of using modern computing devices, especially when you look at the screen for long periods of time. It helps you reduce eye strain, improve legibility, and view content easily and efficiently. However, depending on your settings, it can sometimes be difficult to manage brightness, especially on Windows 11 with the new UI changes. If you're having trouble adjusting brightness, here are all the ways to manage brightness on Windows 11. How to Change Brightness on Windows 11 [10 Ways Explained] Single monitor users can use the following methods to adjust brightness on Windows 11. This includes desktop systems using a single monitor as well as laptops. let's start. Method 1: Use the Action Center The Action Center is accessible

How to Fix Activation Error Code 0xc004f069 in Windows Server How to Fix Activation Error Code 0xc004f069 in Windows Server Jul 22, 2023 am 09:49 AM

The activation process on Windows sometimes takes a sudden turn to display an error message containing this error code 0xc004f069. Although the activation process is online, some older systems running Windows Server may experience this issue. Go through these initial checks, and if they don't help you activate your system, jump to the main solution to resolve the issue. Workaround – close the error message and activation window. Then restart the computer. Retry the Windows activation process from scratch again. Fix 1 – Activate from Terminal Activate Windows Server Edition system from cmd terminal. Stage – 1 Check Windows Server Version You have to check which type of W you are using

See all articles