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?

I have the same problem with you!

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

class CORE_API FMallocLeakDetection