diff options
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 70 |
1 files changed, 28 insertions, 42 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a1b2d502af..4c5cc37766 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1360,20 +1360,18 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id, bool can_retry) U8* buffer = new(std::nothrow) U8[size]; if (!buffer) { + LL_WARNS(LOG_MESH) << "Failed to allocate memory for skin info, size: " << size << LL_ENDL; + // Not sure what size is reasonable for skin info, // but if 20MB allocation failed, we definetely have issues - const S32 MAX_SIZE = 20 * 1024 * 1024; //20MB + const S32 MAX_SIZE = 30 * 1024 * 1024; //30MB if (size < MAX_SIZE) { - LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Bad memory allocation for skin info, size: " << size << LL_ENDL; - } - else - { - // Ignore failures for anomalously large data - LL_WARNS(LOG_MESH) << "Failed to allocate memory for skin info, size: " << size << LL_ENDL; - } - return false; + LLAppViewer::instance()->outOfMemorySoftQuit(); + } // else ignore failures for anomalously large data + LLMutexLock locker(mMutex); + mSkinUnavailableQ.emplace_back(mesh_id); + return true; } LLMeshRepository::sCacheBytesRead += size; ++LLMeshRepository::sCacheReads; @@ -1485,20 +1483,16 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) U8* buffer = new(std::nothrow) U8[size]; if (!buffer) { + LL_WARNS(LOG_MESH) << "Failed to allocate memory for mesh decomposition, size: " << size << LL_ENDL; + // Not sure what size is reasonable for decomposition // but if 20MB allocation failed, we definetely have issues - const S32 MAX_SIZE = 20 * 1024 * 1024; //20MB + const S32 MAX_SIZE = 30 * 1024 * 1024; //30MB if (size < MAX_SIZE) { - LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Failed to allocate memory for mesh decomposition, size: " << size << LL_ENDL; - } - else - { - // Ignore failures for anomalously large decompositiions - LL_WARNS(LOG_MESH) << "Failed to allocate memory for mesh decomposition, size: " << size << LL_ENDL; - } - return false; + LLAppViewer::instance()->outOfMemorySoftQuit(); + } // else ignore failures for anomalously large decompositiions + return true; } LLMeshRepository::sCacheBytesRead += size; ++LLMeshRepository::sCacheReads; @@ -1599,20 +1593,16 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) U8* buffer = new(std::nothrow) U8[size]; if (!buffer) { + LL_WARNS(LOG_MESH) << "Failed to allocate memory for mesh decomposition, size: " << size << LL_ENDL; + // Not sure what size is reasonable for physcis // but if 20MB allocation failed, we definetely have issues - const S32 MAX_SIZE = 20 * 1024 * 1024; //20MB + const S32 MAX_SIZE = 30 * 1024 * 1024; //30MB if (size < MAX_SIZE) { - LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Failed to allocate memory for mesh decomposition, size: " << size << LL_ENDL; - } - else - { - // Ignore failures for anomalously large meshes - LL_WARNS(LOG_MESH) << "Failed to allocate memory for mesh decomposition, size: " << size << LL_ENDL; - } - return false; + LLAppViewer::instance()->outOfMemorySoftQuit(); + } // else ignore failures for anomalously large data + return true; } file.read(buffer, size); @@ -1802,22 +1792,18 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U8* buffer = new(std::nothrow) U8[size]; if (!buffer) { + LL_WARNS(LOG_MESH) << "Can't allocate memory for mesh " << mesh_id << " LOD " << lod << ", size: " << size << LL_ENDL; + // Not sure what size is reasonable for a mesh, // but if 20MB allocation failed, we definetely have issues - const S32 MAX_SIZE = 20 * 1024 * 1024; //20MB + const S32 MAX_SIZE = 30 * 1024 * 1024; //30MB if (size < MAX_SIZE) { - LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Can't allocate memory for mesh " << mesh_id << " LOD " << lod << ", size: " << size << LL_ENDL; - } - else - { - // Ignore failures for anomalously large data - LL_WARNS(LOG_MESH) << "Can't allocate memory for mesh " << mesh_id << " LOD " << lod << ", size: " << size << LL_ENDL; - // todo: for now it will result in indefinite constant retries, should result in timeout - // or in retry-count and disabling mesh. (but usually viewer is beyond saving at this point) - } - return false; + LLAppViewer::instance()->outOfMemorySoftQuit(); + } // else ignore failures for anomalously large data + LLMutexLock lock(mMutex); + mUnavailableQ.push_back(LODRequest(mesh_params, lod)); + return true; } LLMeshRepository::sCacheBytesRead += size; ++LLMeshRepository::sCacheReads; |