Windows Phone 8 アプリケーションのコードの一部でSystem.OutOfMemoryException
. 使用可能なメモリを調べるために使用したかったのですが、名前空間Process.GetCurrentProcess();
に存在しないように見えるため、見つけることができませんでした。System.Diagnostics
Windows API を直接呼び出そうとする唯一のオプションはありますか (それが可能であると仮定しても)? 現在のプロセスを取得したい本当の理由は、アプリケーションで使用可能なメモリの合計を決定することでした。
どんな助けでも親切に感謝します。
編集:
これがコードです
public async static Task<T> InvokeServiceAsync<T>(string BaseAddress, string Path, params object[] ParamArray)
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(BaseAddress);
HttpResponseMessage response = await client.GetAsync(string.Format("{0}{1}", Path, MvcUtilities.BuildWebApiRequest(ParamArray)));
response.EnsureSuccessStatusCode();
T result = await response.Content.ReadAsAsync<T>(); //Out of memory exception
return result;
}