2

私はネットワークベースのアプリケーションに取り組んでいます。初期化とリリースの間のメモリ使用量や送信と受信の間のメモリ使用量など、アプリケーションのさまざまな段階間のメモリ使用量を確認したいと思います。私はグーグルで解決策を見つけようとしましたが、私の要件に完全に一致する投稿はありません。

LinuxとWindowsプラットフォームの両方でチェックポイントベースのメモリプロファイリングを実行するのに役立つツールやプロセスを提案してください。

前もって感謝します


次のコード

_CrtMemState memState1;
_CrtMemCheckpoint(&memState1);

char *p = new char[100];
p = new char[100];
p = new char[100];
p = new char[100];
p = new char[100];

_CrtMemState memState2;
_CrtMemCheckpoint(&memState2);
_CrtMemState memStateDiff;
_CrtMemDifference(&memStateDiff, &memState1, &memState2);
_CrtMemDumpStatistics(&memStateDiff);'

出力をくれます

0 bytes in 0 Free Blocks.
0 bytes in 0 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 0 bytes.
Total allocations: 0 bytes.

Windows7UltimateでVisualStudio2010Professionalを使用しています。

4

1 に答える 1

4

チェックポイント ベースのメモリ使用量は、Visual C++ のデバッグ CRT ライブラリに組み込まれています。

http://msdn.microsoft.com/en-us/library/974tc9t1(v=vs.80).aspx

于 2012-09-13T10:26:59.417 に答える