x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

how can i check memory leak in 4.18?

i set "#define MALLOC_LEAKDETECTION 1" to check memory leak in 4.14 is ok, but i use it in 4.18 got compile err:

2>Module.Engine.30_of_38.cpp.obj : error LNK2019: unresolved external symbol "public: static class FMallocLeakDetection & __cdecl FMallocLeakDetection::Get(void)" (?Get@FMallocLeakDetection@@SAAEAV1@XZ),referenced in function "public: virtual void __cdecl TBaseFunctorDelegateInstance __cdecl(void),class >::Execute(void)const " (?Execute@?$TBaseFunctorDelegateInstance@$$A6A?AU?$TTypeWrapper@X@@XZV@@$$V@@UEBAXXZ) 2>Module.Engine.30_of_38.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl FMallocLeakDetection::SetAllocationCollection(bool,int)" (?SetAllocationCollection@FMallocLeakDetection@@QEAAX_NH@Z),referenced in function "public: void __cdecl FMallocLeakReporter::Start(int,float)" (?Start@FMallocLeakReporter@@QEAAXHM@Z) 2>Module.Engine.30_of_38.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl FMallocLeakDetection::ClearData(void)" (?ClearData@FMallocLeakDetection@@QEAAXXZ),referenced in function "public: virtual void __cdecl TBaseFunctorDelegateInstance __cdecl(void),class >::Execute(void)const " (?Execute@?$TBaseFunctorDelegateInstance@$$A6A?AU?$TTypeWrapper@X@@XZV@@$$V@@UEBAXXZ) 2>Module.Engine.30_of_38.cpp.obj : error LNK2019: unresolved external symbol "public: int __cdecl FMallocLeakDetection::DumpOpenCallstacks(wchar_t const ,struct FMallocLeakReportOptions const &)" (?DumpOpenCallstacks@FMallocLeakDetection@@QEAAHPEB_WAEBUFMallocLeakReportOptions@@@Z),referenced in function "public: int __cdecl FMallocLeakReporter::WriteReport(wchar_t const ,struct FMallocLeakReportOptions const &)" (?WriteReport@FMallocLeakReporter@@QEAAHPEB_WAEBUFMallocLeakReportOptions@@@Z) 2>Module.Engine.30_of_38.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl FMallocLeakDetection::CheckpointLinearFit(void)" (?CheckpointLinearFit@FMallocLeakDetection@@QEAAXXZ),referenced in function "protected: void __cdecl FMallocLeakReporter::Checkpoint(void)" (?Checkpoint@FMallocLeakReporter@@IEAAXXZ)


so i use #ifndef MALLOC_LEAKDETECTION #if WITH_EDITOR|UE_BUILD_SHIPPING #define MALLOC_LEAKDETECTION 0 #else #define MALLOC_LEAKDETECTION 1 #endif #endif replace
#define MALLOC_LEAKDETECTION 1 So compiled it OK. but i got other issue,memory report is not complete as this


AllocSize: 6117 KB, Num: 16312, FirstFrame 1573, LastFrame 17883, KnownDeleter: 0, KnownTrimmer: 0, Alloc Rate 63.56B/frame 0x0000000004782EE7 WarShipServe!FWindowsPlatformStackWalk::CaptureStackBackTrace() [f:\unrealengine-4.18\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:257] 0x0000000004476573 WarShipServe!FMallocLeakDetection::Malloc() [f:\unrealengine-4.18\engine\source\runtime\core\private\hal\mallocleakdetection.cpp:451] 0x000000000447E78A WarShipServe!FMallocLeakDetection::Realloc() [f:\unrealengine-4.18\engine\source\runtime\core\private\hal\mallocleakdetection.cpp:518] 0x000000000447ECCE WarShipServe!FMallocLeakDetectionProxy::Realloc() [f:\unrealengine-4.18\engine\source\runtime\core\private\hal\mallocleakdetection.h:255] 0x000000000447EDC7 WarShipServe!FMallocPoisonProxy::Realloc() [f:\unrealengine-4.18\engine\source\runtime\core\public\hal\mallocpoisonproxy.h:66] 0x000000000447F0F5 WarShipServe!FMemory::Realloc() [f:\unrealengine-4.18\engine\source\runtime\core\public\hal\fmemory.inl:48] 0x00000000042D12AA WarShipServe!TArray >,FDefaultAllocator>::ResizeTo() [f:\unrealengine-4.18\engine\source\runtime\core\public\containers\array.h:2265] 0x0000000004730963 WarShipServe!TSet,TDefaultMapHashableKeyFuncs,FDefaultSetAllocator>::Empty() [f:\unrealengine-4.18\engine\source\runtime\core\public\containers\set.h:352] 0x000000000471F9F8 WarShipServe!TSet,TDefaultMapHashableKeyFuncs,FDefaultSetAllocator>::operator=() [f:\unrealengine-4.18\engine\source\runtime\core\public\containers\set.h:251] 0x0000000004732E2E WarShipServe!FStatsWriteFile::FinalizeSavingData() [f:\unrealengine-4.18\engine\source\runtime\core\private\stats\statsfile.cpp:424] 0x00000000047303A7 WarShipServe!FAsyncTask::DoWork() [f:\unrealengine-4.18\engine\source\runtime\core\public\async\asyncwork.h:264] 0x000000000472FE1E WarShipServe!FAsyncTask::DoThreadedWork() [f:\unrealengine-4.18\engine\source\runtime\core\public\async\asyncwork.h:288] 0x0000000004488E3D WarShipServe!FQueuedThread::Run() [f:\unrealengine-4.18\engine\source\runtime\core\private\hal\threadingbase.cpp:451] 0x00000000047A2AFC WarShipServe!FRunnableThreadWin::Run() [f:\unrealengine-4.18\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:76] 0x0000000004793933 WarShipServe!FRunnableThreadWin::GuardedRun() [f:\unrealengine-4.18\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:33] 0x00000000933B8364 KERNEL32.DLL!UnknownFunction [] 0x00000000942970D1 ntdll.dll!UnknownFunction []


how can i get true memory leak?

Product Version: UE 4.18
Tags:
more ▼

asked Jan 04 '18 at 03:12 AM in C++ Programming

avatar image

yanghsong
6 1 1 2

avatar image guyun008 Feb 13 '18 at 03:13 AM

I have the same problem with you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Add CORE_API macro to Engine\Source\Runtime\Core\Private\HAL\MallocLeakDetection.h like this:

 class CORE_API FMallocLeakDetection
more ▼

answered Mar 21 '18 at 06:37 PM

avatar image

Rexar505
16 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question