内存泄漏及检测(英文)

LabelImg闪退问题全面排查与高效标注技巧分享 本文详细解析了LabelImg闪退问题的全面排查方法,包括配置文件冲突、中文路径问题及环境依赖检查,并分享了高效标注的实战技巧,如快捷键使用、预设标签智能用法和自动保存策略,帮助用户提升标注效率和质量。 阅读详情

Copyright by 云破日出

 

 

1.     Introduction

1.1       What we are dealing with

Before finding memory leak, we should have an overview of what we are dealing with. Memory leak on Windows platform contains following aspects:

§  Memory leak on CRT, Global, Heap, Virtual, COM, …

§  Handles leak when using GDI, Kernel, Common control, winsock, winhttp, advapi, …

Many memory leak detection tools also detect errors when using memory, which include memory conflict, memory overrun, etc.

 

1.2       Leak detection tools

Figure 1  Leak detection tools

 

1.3       Leak category

Figure 2  Leak category

 

1.4       Work flow

Although we can use different tools to detect memory leak, but there are some common steps to do.

       

Figure 3  Leak detection work flow

 

2.     Tools

2.1       CRT Heap Check Routine

Advantage:

Simple

Speedy

Low cost

Disadvantage:

Can only detect memory leaks allocated by new and malloc

Can only run under Visual Studio IDE

No call stack information, hard to find the leak especially when multi-allocation in same place

Detail:

                Write the following code in the firstly included .h file

                #define _CRTDBG_MAP_ALLOC

                #include <stdlib.h>

                #include <crtdbg.h>

                Write the following code at last to print the result to Debug window

_CrtDumpMemoryLeaks();

Demo:

Figure 4  CRT Heap Check Routing

Notice:

                If _CRTDBG_MAP_ALLOC is not defined before including crtdbg.h, the output imformation will not contain the leak file.

Analyse:

                The output string in Debug window between Dumping objects and Object dump complete has the following meanings (marks are in the window above):

(1)     Leak file and line number

(2)     Memory allocation sequence

(3)     Type of leak block

a.       normal block       allocated by your code

b.       client block                          for MFC destructor

c.       CRT block                            CRT allocated

d.       free block                            freed block (will not appear in the output of the leak dump)

e.       ignore block        programmer can claim blocks ignored by CRT check routine

(4)     The leak address

(5)     ASCII and Binary version of leak content

 

 

2.2       Visual Leak Detector

This is a wrap for CRT heap check routines.

Advantage:

                Same with CRT check routines, but provides call stack information

Disadvantage:

                Same with CRT check routines, but provides call stack information

Detail:

§  Download the zip from CodeProject

§  Copy the VLD library (*.lib) files to your Visual C++ installation's "lib" subdirectory.

§  Copy the VLD header files (vld.h and vldapi.h) to your Visual C++ installation's "include" subdirectory.

§  In the source file containing your program's main entry point, include the vld.h header file. It's best, but not absolutely required, to include this header before any other header files, except for stdafx.h. If the source file, include stdafx.h, then vld.h should be included after it.

§  If you are running Windows 2000 or earlier, then you will need to copy dbghelp.dll to the directory where the executable being debugged resides.

§  Build the debug version of your project.

Demo:

Figure 5  Visual Leak Detector

Notice:

                The library works only when defines _DEBUG, so the release version will not be effected even if including <vld.h>

Analyse:

                The stack trace information and entire leaked data content was print to the output window in VC IDE.

 

2.3       Memory Validator

Memory Validator is a speedy and powerful tool for memory error detecting. It is able to monitor the following kinds of resources :

Figure 6  Memory Validator – Setting Dialog 1

Advantage

                Powerful and handy

Disadvantage

                Sometimes not accurate

Demo

§  Settings

o    Set to monitor one specific resource one time on large scale software. See the collect setting above, and the display setting below.

Figure 7  Memory Validator - Setting Dialog 2

o    Set to monitor only some module of the large scale software

Figure 8  Memory Validator - Setting Dialog 3

§  Watermark

o        Check the leak during the two specific scenarios. We can take a snapshot of memory usage before doing suspicious operation and then take another snapshot when finishing the operation. Check the Compared result data provided by the tool.

Figure 9  Memory Validator – Adding watermark

Figure 10  Memory Validator - All the allocation between two watermarks

§  Objects : Tells us which kind and how many objects existed in memory or leaked after exiting the program. Sort by Number is recommended.

Figure 11  Memory Validator - Objects

§  Filters : Use filters to select the data you are interested in.

Figure 12  Memory Validator - Filters

§  For icons and other view usage, please check the help manual of Memory Validator

 

2.4       BoundsChecker

BoundsChecker is a memory detect tool developed by Compuware. Like memory validator, it uses hook to detect memory leaks. They are almost the same.

Here is some pictures taken from BoundsChecker

Figure 13  Setting Dialog

Figure 14  Boundschecker - Summary Dialog

Figure 15  Leak Detail

 

2.5       UMDH & LeakExplorer

UMDH is a tool provide by Microsoft. Through comparing two memory dump, UMDH tells us how much memory is allocated between the dump. Since not all the memory allocation is leak, so we should do the same operation between the two dump, and get the third dump. If memory increase steadily in the same context, it is quite suspicious. Since there are so much allocations information from kernel, and the output of UMDH is txt file, we have great difficulty in finding leaks. Autocad team developed a tool to analyze the output txt files by UMDH, this is called LeakExplorer.

 

Advantage

                Accurate

                Speedy

                Not using hook, no impact on the program to be tested

Disadvantage

                Not handy, Cost a lot of time to find the leak

Demo

                UMDH.wmv

 


 

 

 

Appendix: Background

1.1       Layered Memory Management in Win32

 

Figure 16  Memory Layer in Windows NT based system

Local, Global memory API are provided by previously released windows api. There used to be a global heap for all the applications, which shares it concurrently, and multiple, private local heaps, one for each application. After win 2000, there is no difference between local heap and global heap. Actually there is no global heap now.

 

1.2       Memory allocation pair

 

 

Allocator

Deallocator

CRT

new

delete

malloc

Free

Virtual Memory

VirtualAlloc

VirtualFree

Heap

HeapAlloc

HeapFree

Global

GlobalAlloc

GlobalFree

Local

LocalAlloc

LocalFree

Com

CoTaskMemAlloc

CoTaskMemFree

SysAllocString*

SysFreeString

SafeArrayCreate

SafeArrayDestroy

Figure 17  Memory allocation pair

Most memory leak happens because of misusing the pair of allocator and free functions. For example, use free() to new(), or use delete() to malloc(), or forget to use free function after allocating memory. But there is an exception, that is Global heap and local heap memory api, as described above.

 

There two kinds of heaps for each application now. One is called default heap, the CRT memory API and Local, Global API allocate memory on it by default. Besides, we can also use HeapCreate to generate a dynamic heap. By using HeapAlloc and HeapFree, we can allocate and free memory on the dynamic heap. The most important difference between these two kinds of heaps is that the default heap is thread-safe. That is to say, we have to do synchronizations for the heap created by HeapCreate.

 

Since we are familiar with the CRT memory management, I will skip that. You can get the leak scenarios for CRT leaks in appendix. Those are tutorials from memory validator, which will be introduced in chapter 2.

 

1.3       Memory management in COM

 

1.3.1          COM pointer

 

All COM components use reference counting technology, they all have AddRef() to increase the count number, and Release() to decrease the count number. If the count number falls to 0, Release() will destroy the COM point and free its memory. So we should use a COM pointer like this.

 
   
 

pCOMNew = pCOM;

pCOM->AddRef();

…

If ( NULL != pCOM)

{

    pCOM->Release();

    pCOM = NULL;

}

If ( NULL != pCOMNEW)

{

    pCOMNEW->Release()

    pCOMNEW = NULL;

}

 

                In most cases we don’t need to write such low level code, for example, we can use macro to replace code of xxx->Release(); xxx = NULL (like SAFEDELETE in directx). Or, we can use a simple smart pointer like this:

 

template <class P>

class CSmartPtr

{

    P* p;

public:

    CSmartPtr(P* ptr) { p = ptr; if(p) p->AddRef(); }

    ~CSmartPtr() { if(p) p->Release(); }

};

 

                And for ATL : CComPtr and CComQIPtr, which are also smart pointer. Just remember when these COM objects goes out of their scope, they will destroy automatically, we needn’t destroy them again. But a lot of memory detection tools report these are memory leaks.

 

1.3.2          BSTR

 

The string operation leaks memory easily, not only because the string often used as a parameter passed everywhere, which would be easily forgotten to free, but also because not understand the library we use.

BSTR is null-terminated, two-bytes string, so its null-termination also has 2 bytes. The name of BSTR means “Basic STRing”, it can be used in Visual Basic and java.lang.string, and any other language support Automation. We usually use CComBSTR in ATL to manipulate the string. I mention it here just because it use SysAllocString and SysFreeString to allocate and free the memory, not malloc and free in CRT. So when there is a memory leak, we can’t expect the CRT memory check routine to find it.

For more information about CComBSTR, you can see Chapter 5, Data Conversion Classes in <Inside ATL>.

 

1.3.3          SafeArray

 

Like BSTR, SafeArray can also be recognized in VB and Java. We use SafeArrayCreate to allocate memory, and use SafeArrayDestroy to free the memory. In ATL, there is an alternative way: CComSafeArray. It’s a template class of SafeArray. They need special attention also because SafeArrayCreate and SafeArrayDestory are not CRT functions. Some memory detection tool will miss the real leaks, and some tools will report a correct scenario as memory leak.

 

1.3.4          CoTaskMemAlloc and CoTaskMemFree

 

As mentioned in 1.3.2, there are two kinds of heaps. The default heap meets our needs in most cases, but for COM, we usually allocate memory in one process, and free memory in another process. Clearly, a conventional heap has no way to handle this, so CoTaskMemAlloc and CoTaskMemFree is used instead. The automatically generated proxy-stub code can properly allocate and free memory across COM boundaries. COM's remoting infrastructure does all the dirty work needed to create the illusion of a single heap that spans processes.

In ATL, there is an interface called IAtlMemMgr, which has the following members:

__interface IAtlMemMgr {                       

public:                                         

    void* Allocate( size_t nBytes ) ;          

    void Free( void* p ) ;                     

    void* Reallocate( void* p, size_t nBytes ) ;

    size_t GetSize( void* p ) ;                

}; 

We can implement it for special usage. ATL also has 5 concrete class implemented IAtlMemMgr, they can be used under different situation, as described in the following table, the left column is classes in ATL, the right column is the low level functions each class used.

 

Memory Manager Class

Heap Functions Used

CComHeap

CoTaskMemAlloc,

CoTaskMemFree,

CoTaskMemRealloc,

IMalloc::GetSize

CCRTHeap

malloc,

free,

realloc

CLocalHeap

LocalAlloc,

LocalFree,

LocalReAlloc,

LocalSize

CGlobalHeap

GlobalAlloc,

GlobalFree,

GlobalReAlloc,

GlobalSize

CWin32Heap

HeapAlloc,

HeapFree,

HeapReAlloc,

HeapSize

 

1.3.5          COM objects’ Reference count

If we found a lot leak within one class, we can infer that one instance of that class wasn’t released, and its destructor wasn’t invoked at all. Usually this can be caused by three scenarios:

§  Object pointer overwriting

§  Forgetting invoke delete operator on the pointer passed by another function

§  Incorrect com object reference count

The first two scenario is easy to detect by using memory check tools, but the third one is hard to locate where has gone wrong. Let’s see why this is difficult. The reference count itself is simple, we only should make sure that AddRef() and Release() matches on a non-smart com pointer, just like new() and delete().

There are 3 kinds of smart pointer in COM, which manipulate reference count automatically.

§  Smart pointer provided by ATL template ( CComPtr and CComQIPtr )

§  Smart pointer provided by compiler ( _com_ptr_t )

§  Smart pointer defined by ourselves

Let’s pick smart pointer from ATL template, other smart pointers are the same. CComPtr and CComQIPtr are subclass of CComPtrBase, its release method is defined like this:

      // Release the interface and set to NULL

      void Release() throw()

      {

            T* pTemp = p;

            if (pTemp)

            {

                  p = NULL;

                  pTemp->Release();

            }

   }

Usually we needn’t call release on a smart pointer, because it can be released automatically. But if we do call release on a class member, let’s see what happens. After calling release, the class member is assigned to be NULL. But actually its reference count may still greater than 0. When the object goes out of scope, the auto-release action will not perform, since the pointer is NULL. Finally the COM object will have no change to release because its reference count is greater than 0.

We also should pay great attention on using non-smart pointer and smart point together. “=” operator is only overloaded for assignments between two smart pointers. When the left side of “=” is just an interface, AddRef() will not be called. We should call AddRef() and Release() manually in this case.

 

1.4       Handle Management

Like memory allocation pairs, handles also has their creator and destroy function pair. We should use them together and make them match.

Appendix: CRT Leak scenario

n  incorrect usage: double delete

    1284 :     char    *ptr;

    1285 :

    1286 :     ptr = new char [10];

    1287 :     delete [] ptr;              // correct cleanup

    1288 :     delete [] ptr;              // incorrect doublecleanup

    1289 : }

 

n  incorrect usage: double free

    1082 :

   1083 :     char    *ptr;

    1084 :

    1085 :     ptr = (char *)malloc(10);

    1086 :     free(ptr);                  // correct cleanup

    1087 :     free(ptr);                  // incorrect doublecleanup

    1088 : }

 

n  free the wrong location

    1107 :     // allocate some memory then free the wrong location, inside the block

    1108 :

    1109 :     ptr = (char *)malloc(3);

    1110 :     for(i = 1; i < 3; i++)

    1111 :         free(ptr + i);          // incorrect cleanup

    1112 :

    1113 :     // correct cleanup

    1114 :

    1115 :     free(ptr);                  // correct

 

n  delete the wrong location

    1314 :     // allocate some memory then free the wrong location, inside the block

    1315 :

    1316 :     ptr = new char [3];

    1317 :     for(i = 1; i < 3; i++)

    1318 :     {

    1319 :         delete (ptr + i);       // incorrect cleanup

    1320 :         delete [] (ptr + i);    // incorrect cleanup

    1321 :     }

 

n  realloc the wrong location

    1367 :     ptr = (char *)malloc(10);

    1368 :     p = (char *)realloc(ptr + 1, 20);       // incorrect realloc

    1369 :     p = (char *)realloc(ptr - 1, 20);       // incorrect realloc

    1370 :     ptr = (char *)realloc(ptr, 20);         // correct realloc

 

n  delete malloc/calloc/relloc’d memory

    4708 :     char    *ptr;

    4709 :

    4710 :     ptr = (char *)malloc(1000);

    4711 :     delete ptr;             // incorrect (it will work with Visual Studio 6.0 debug, but thats relying on a side-effect caused by new wrapping free, if they change the implementation, bang codes the code!)

    4712 :     delete [] ptr;          // incorrect (it will work with Visual Studio 6.0 debug, but thats relying on a side-effect caused by new wrapping free, if they change the implementation, bang codes the code!)

    4713 :     free(ptr);              // correct

 

n  free/relloc new’d memory

    4764 :     char    *ptr;

    4765 :

    4766 :     ptr = new char [1000];

    4767 :     free(ptr);              // incorrect (it will work with Visual Studio 6.0 debug, but thats relying on a side-effect caused by new wrapping free, if they change the implementation, bang codes the code!)

    4768 :     delete [] ptr;          // correct

 

n  HeapReAlloc and HeapFree

 

n  Memory overwritten

    1502 :         char    *p;

    1503 :

    1504 :         p = new char [tmd.sizeToAllocate];

    1505 :         p[tmd.sizeToAllocate] = '/0';

 

n  Memory underwritten

    1479 :         char    *p;

    1480 :

    1481 :         p = new char [tmd.sizeToAllocate];

    1482 :         *(p - 1) = '/0';

 

n  Uninitialized on stack/heap

 

n  Heap memory overrun

 

    1923 :     // warning, the very nature of this overrun may cause this program

    1924 :     // to crash since it damages the CRT heap

    1925 :

    1926 :     char    *memory;

    1927 :

    1928 :     memory = new char[100];

    1929 :     memcpy(memory + 3, memory, 100);

 

n  Heap memory underrun

    1952 :     // warning, the very nature of this overrun may cause this program

    1953 :     // to crash since it damages the CRT heap

    1954 :

    1955 :     char    *memory;

    1956 :

    1957 :     memory = new char[100];

    1958 :     memcpy(memory - 3, memory, 100);

    1959 :

    1960 :     // I'll allow this to leak, since if I try to free it the damaged stack will

    1961 :     // be found, and if I don't try to free it, the program may not crash (for a while)

    1962 : }

 

n  Stack memory overrun

 

n  Stack memory underrun

 

n  Strcpy and wcscpy

    5081 :     char    *charBuffer = new char[20];

    5082 :     wchar_t *wcharBuffer = new wchar_t[20];  

    5085 :     char    *charBufferSource = new char[20];

    5086 :     wchar_t *wcharBufferSource = new wchar_t[20];

    5090 :     charBufferSource[0] = '/0';

    5091 :     wcharBufferSource[0] = _T('/0');

    5092:      strcpy(charBufferSource, "some test text56789");

    5093:      wcscpy(wcharBufferSource, L"some test text56789");

    5112:      // overwrite beginning of buffer

    5113:      strcpy(&charBuffer[-4], charBufferSource);

    5114:      wcscpy(&wcharBuffer[-4], wcharBufferSource);

    5115:      strncpy(&charBuffer[-4], charBufferSource, 20);

    5116:      wcsncpy(&wcharBuffer[-4], wcharBufferSource, 20);

    5117:     

    5118:      // overwrite end of buffer

    5119:      strcpy(&charBuffer[10], charBufferSource);

    5120:      wcscpy(&wcharBuffer[10], wcharBufferSource);

    5121:      strncpy(&charBuffer[10], charBufferSource, 20);

    5122:      wcsncpy(&wcharBuffer[10], wcharBufferSource, 20);

    …

    5146 :     // at this point, deleting the data may cause the program to crash (as the heap has

    5147 :     // been corrupted), if it doesn't the program will most likely crash later on

    5148 :

    5149 :     delete [] charBuffer;

    5150 :     delete [] wcharBuffer;

 

n  Forget deleting the object in an array

    1863 :     for(i = 0; i < 10; i++)

    1864 :     {

    1865 :         char    text[10];

    1866 :

    1867 :         sprintf(text, "%d", i);

    1868 :         array[i] = new CString(text);

    1869 :     }

    1870 :

    1871 :     // cleanup the array, but leak the contents

    1872 :

    1873 :     delete [] array;

 

n  Call functions on a deleted object

简评C++内存泄漏检测工具 C++内存泄漏检测工具简评 阅读详情

相关推荐

Python内存优化工具:python_memory_validator

本文还有配套的精品资源,点击获取 简介:"python_memory_validator" 是一个用于监控和优化Python程序内存使用的工具,它包括实时内存监控、内存泄漏检测、对象分析、内存快照比较、性能报告生成、IDE集成和命令行接口等功能。该工具旨在帮助开发者在处理大数据、长时间运行服务或内存受限环境中,更好地理解和控制内存使用,提升性能和稳定性。 1. 实...

weixin_35756624的博客 1089

[Tool] Memory leak & performance profiling tools for C# / C++

For C++: Memory analysis tools: 1. C++ memory leak detector - Memory Validator (http://www.softwareverify.com/index.html) 2. Other as references: Purify from IBM Performance profiling tool...

weixin_33751566的博客 935

VC++ 6.0英文安装包获取、安装与配置全指南

在软件开发和系统维护领域,遗留项目维护和运行库依赖是常见的技术挑战。当需要维护基于特定历史编译环境构建的应用程序时,环境还原的准确性直接关系到代码的编译成功率和运行时稳定性。Visual C++ 6.0作为上世纪90年代末至21世纪初Windows平台开发的主流工具,其编译器和运行时库(如msvcp60.dll、mfc42.dll)构成了许多遗留系统的技术基础。从技术原理看,这些历史工具链与现代操作系统存在兼容性差异,尤其是在高分辨率显示、系统文件重定向等方面。其技术价值在于为遗留项目维护、历史代码研究和特

weixin_28828243的博客 349

内存泄露&&资源泄漏及解决

new/malloc的,不释放,是内存泄露, COM接口不Release的,是内存泄露。 创建的线程,Socket,GDI对象等,不close是资源泄露。 使用工具: 1)BoundsChecker :(http://www.compuware.com/)(首选B

leer168的专栏 1631

Android内存泄漏信息介绍(英文)

Android内存泄漏说明文件 英文 08-06 13:53:42.082: D/dalvikvm(12152): GC_CONCURRENT freed 1842K, 12% free 15412K/17399K, paused 1ms+3ms

python memory validator

python memory validator

Windows平台上C++开发内存泄漏检查方法

<br />Windows平台上C++开发内存泄漏检查方法 充分的利用调试工具可以非常方便地避免内存泄漏问题。 这里介绍两种方法,互为补充,第一种是VC编译器提供的方法,第二种是专用的内存泄漏检查工具Memmory Validator。这两种方法的基本原理是一样的:内存分配要通过CRT在运行时实现,只要在分配内存和释放内存时分别做好记录,程序结束时对比分配内存和释放内存的记录就可以确定是不是有内存泄漏。其中,第一种方法重载了new操作符,第二种方法是替换了CRT运行时库,在用户程序与运行库之间加了一层,用于

autoopen的专栏 555

慕课软件质量保证与测试(习题集)

慕课金陵科技学院.软件质量保证与测试.期末复习.习题汇总0 总目录1 绪论1.1 软件质量保证与测试的产生与发展1.2 软件缺陷,软件错误,软件故障1.3 软件质量保证与测试的意义,原则和挑战1.4 单元测试1.5 课后作业2 软件测试策略2.1 软件测试的模型,过程和生命周期2.2 软件测试的方法和技术2.3 单元测试2.4 课后作业3 黑盒测试3.1 黑盒测试概述3.2 等价类划分测试3.3 边界值测试3.4 错误推测法3.5 判定表驱动法3.6 因果图法3.7 场景法3.8 正交实验法3.9 单元测试

weixin_42473228的博客 5万+

记几个C++程序Memory Leak检查工具

个人用过的最好用的:· BoundsChecker商业软件,可惜似乎已经停止开发了(见http://blogs.msdn.com/matt_pietrek/archive/2007/06/11/r-i-p-numega-lab.aspx,但close lab似乎不一定意味着终止相关产品开发,但肯定会流失一些Experts/Master,而且其母公司现在的定位是一家IT服务公司,哎,多好的产品啊!可

大卫的思维空间 3484

52、基于格的具有解密密钥暴露抗性的可撤销(分层)身份基加密方案

本文提出了首个基于格的具有解密密钥暴露抗性(DKER)的可撤销分层身份基加密(RHIBE)方案。通过引入分层密文、分层解密密钥和级别转换密钥等创新工具,克服了格结构与传统密钥重新随机化属性不匹配的难题。该方案不仅支持可扩展的密钥撤销机制,还具备密钥委托功能,为后量子密码学领域的发展提供了新的思路和方法。

efc12345678的博客 123

工业产线瑕疵检测:基于 YOLO 的自动化质检系统实战

从工业瑕疵数据集构建到模型训练,从桌面检测界面到产线适用性优化,本文覆盖了一套工业质检系统的完整路线。这个场景的核心评价指标不是最高精度,而是在保证 recall ≥ 0.95 的前提下尽可能压低 false positive——因为漏检的直接成本(客户投诉、质量事故)远高于误报的成本(人工复检)。部署时先设一个偏低的置信度阈值确保覆盖,再通过持续收集人工复检数据来逐步调优。

m0_71589036的博客 67

SDL中英文混排与内存泄漏的底层原理与工程实践

SDL_TTF作为C/C++图形开发中常用的字体渲染模块,其核心能力受限于Unicode字形映射机制与无状态内存管理模型。理解UTF-8码点解析、freetype字形加载流程及SDL_Surface像素内存所有权归属,是解决中文乱码与持续内存增长的关键。技术价值在于规避‘渲染即分配’陷阱,建立字体缓存、字符串LRU缓存与显式像素释放三位一体的抗泄漏架构。广泛应用于工控HMI、车载仪表盘、数字标牌等需长期稳定运行的嵌入式GUI场景,尤其适配Noto Sans CJK、文泉驿等开源中文字体与SDL2.0.20+

weixin_29169899的博客 216

企业级 Token 中转架构设计:高并发、多模型、费用监控一次搞定

摘要:本文针对企业级AI开发中的多模型接口混乱、高并发稳定性差及Token费用失控等痛点,提出一套2026年企业级Token中转架构解决方案。该方案采用五层分层设计(接入层、网关层、调度层、服务层、存储层),实现多模型统一接口、智能路由、高并发限流容错及精细化成本监控。核心功能包括:异构模型标准化接入、动态路由策略(场景/成本/负载/容灾)、多级限流熔断机制、全链路Token计费与安全防封体系(指纹清洗、IP池隔离)。通过分层解耦与模块化设计,企业可降低50%成本、提升99%稳定性,并避免封号风险。文章还提

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 146

Android STT API实战:如何用AI辅助开发提升语音识别效率

基于火山引擎豆包大模型,从零搭建一个实时语音通话应用。它不是简单的问答,而是需要你亲手打通 ASR(语音识别)→ LLM(大脑思考)→ TTS(语音合成)的完整 WebSocket 链路。对于想要掌握 AI 原生应用架构的同学来说,这是个绝佳的练手项目。架构理解:掌握实时语音应用的完整技术链路(ASR→LLM→TTS)技能提升:学会申请、配置与调用火山引擎AI服务定制能力:通过代码修改自定义角色性格与音色,实现“从使用到创造”从0到1构建生产级别应用,脱离Demo,点击打开。

2600_94960158的博客 290

EPLAN 电气制图(六):结构盒与设备管理器核心概念(基础知识选看)

结构盒是 EPLAN 中用于标识元件安装位置的逻辑容器,非实际设备或黑盒,仅用于原理图中划分功能区域或物理位置(如 “柜内”“柜外”)。标识符设置:在 “显示设备标识符” 中输入位置代号(如 “+ 柜外”),完整格式为 “= 高层代号 + 位置代号”;筛选与定位:通过 “筛选器” 按类别(如电机、接触器)快速查找设备,右键 “转到(图形)” 可高亮定位图纸中的元件;设备保护:重要设备可启用保护(【项目数据】→【设备】→【启用设备保护】),防止误删除(显示橙色圆圈标记)。

电工 1057

C#实现低通和高通滤波算法

低通滤波器允许通过低于某个截止频率的信号成分,并且抑制高于该频率的成分。而高通滤波器则允许通过高于某个截止频率的信号成分,并抑制低于该频率的成分。巴特沃斯滤波器是一种对称的滤波器,具有平坦的幅度响应和最小的群延迟。低通和高通滤波是数字信号处理中常用的滤波技术,用于滤除或增强信号中的特定频率成分。在本篇文章中,我们将使用C#编程语言来实现低通和高通滤波算法。以上就是使用C#实现低通和高通滤波算法的示例代码。你可以根据自己的需求调整截止频率和采样率,将这些代码应用于你的项目中。是滤波器的截止频率,

XisVisual_Basic的博客 1275

YOLOv8路面裂缝检测系统实战:从数据标注到中英文界面部署全流程

目标检测是计算机视觉领域最成熟的技术方向之一,它让机器不仅能“看见”图像,还能定位出其中的关键对象。从原理上讲,基于深度学习的检测模型通过卷积神经网络提取特征,在回归边界框与类别的过程中完成端到端的识别,具备速度快、精度高、易部署等优势。这类方案在交通基础设施巡检、工业质检、智慧城市等场景中应用广泛,尤其适合替代人工完成重复性高、标准易漂移的视觉初筛任务。本文以路面裂缝检测为例,系统梳理了从数据集构建、小目标标注规范、模型选型与调优,到Flask服务搭建、中英文双语界面适配、Docker与边缘设备部署的完整

weixin_29050513的博客 153

发那科机器人karel程序

备份和查看发那科机器人中的 Karel 程序的过程主要包括从示教器中备份程序,并通过 RoboGuide 等仿真软件查看和运行程序。步骤相对简单,但需要确保你的设备和软件已经设置好,可以通过 FTP 或直接从示教器的外部存储设备进行操作。如果你在操作过程中遇到问题,建议查阅相关的用户手册或联系发那科的技术支持,确保设备设置正确。如果你有更具体的问题或需要进一步帮助,欢迎继续提问!希望如上措施及解决方案能够帮到有需要的你。

**My Coding Family** 1602

vc++内存泄漏检测

vc++内存泄漏检测

huangyimin的专栏 1389

21天学会基于 Linux 的 NPU 固件开发--12.3 如何参与 Linux 内核 NPU 子系统开发

从修复一个简单的文档拼写错误开始,或者为现有的开源 NPU 驱动(如 Sophgo, StarFive, Etinix 等厂商已上游化的驱动)添加一个缺失的 IOCTL 支持或优化一个算子,都是伟大的第一步。在 2026 年的 Linux Kernel (v6.12+) 中,NPU 驱动不再是孤立的字符设备,而是深度集成在 DRM 和 DMA-BUF 生态中,实现了与 GPU 类似的资源管理和调度能力。内核驱动必须提供清晰的 UAPI (User API),通常定义在。Step 4: 合并 (Merge)

amy_mhd的博客 67

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

使用 CRT 调试功能来检测内存泄漏

使用 CRT 调试功能来检测内存泄漏首先,检测内存泄漏的基本工具是调试器和 CRT 调试堆函数。为了使用调试堆函数,必须在要检测内存泄漏和调试的程序中添加下面的语句: #define _CRTDBG_MAP_ALLOC #include #include #include "debug_new.h"   MSDN 如是说:“必须保证上面声明的顺序,如果改变了顺序,可能不能正常工作。”至

难得糊涂 1997

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

检测内存泄漏

最近看了周星星 Blog 中的一篇文章:“VC++6.0中内存泄漏检测”,受益匪浅,便运行其例子代码想看看 Output 窗口中的输出结果,可惜怎么弄其输出都不是预期的东西,郁闷了半天,便到水坛里找到周星星,请求他指点一、二,然而未果。没有办法,最后我一头栽进 MSDN 库狂搜了一把,功夫不负有心人,我搜出很多有关这方面的资料,没过多久我便基本上就找到了答案...... 首先,检测内存泄漏的基

痞子龙3D编程 1538

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Google开源Leak Finder——用于检测内存泄漏的JavaScript工具

本文来源于我在InfoQ中文站翻译的文章,原文地址是:http://www.infoq.com/cn/news/2013/01/JavaScript-Leak-Finder近日,Google开源了Leak Finder,这款工具可以查看JavaScript应用的堆,进而发现内存泄漏。作为一门垃圾收集语言,JavaScript并不会出现常见的内存泄露情况,特别是像C++等语言中所见到的那种。但如果依

张龙(风中叶)的专栏 2657

VC++ 6.0 中如何使用 CRT 调试功能来检测内存泄漏(转)

VC++ 6.0 中如何使用 CRT 调试功能来检测内存泄漏作者:JerryZ下载例子源代码  最近看了周星星 Blog 中的一篇文章:“VC++6.0中内存泄漏检测”,受益匪浅,便运行其例子代码想看看 Output 窗口中的输出结果,可惜怎么弄其输出都不是预期的东西,郁闷了半天,便到水坛里找到周星星,请求他指点一、二,然而未果。没有办法,最后我一头栽进 MSDN 库狂搜了一把,功夫不负有心人

bairny的专栏 1万+

VC++ 6.0 中如何使用 CRT 调试功能来检测内存泄漏 调试方法

VC++ 6.0 中如何使用 CRT 调试功能来检测内存泄漏 作者:JerryZ 下载例子源代码   最近看了周星星 Blog 中的一篇文章:“VC++6.0中内存泄漏检测”,受益匪浅,便运行其例子代码想看看 Output 窗口中的输出结果,可惜怎么弄其输出都不是预期的东西,郁闷了半天,便到水坛里找到周星星,请求他指点一、二,然而未果。没有办法,最后我一头栽进 MSDN 库狂搜了

yxnyxnyxnyxnyxn的专栏 2904
上一篇: 定制命令行窗口
下一篇: Direct3D的一些小贴士
MikeFeng
博客等级 码龄23年 27粉丝 29原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值