summaryrefslogtreecommitdiff
path: root/indra/llcommon/llmemory.cpp
AgeCommit message (Collapse)Author
2018-06-02Use more typedefs to simplify sync between viewer and sim env settings code.Graham Linden
2018-01-30MAINT-8091 Removed deprecated and unused private memory poolingAndrey Kleshchev
2017-05-10DRTVWR-418, MAINT-6996: Update Mac mem queries (per Drake Arconis)Nat Goodspeed
Drake points out that the OS X 64-bit-capable memory-query APIs recommended in comments by some long-ago maintainer are by now themselves obsolete. He offered this patch to update us to current macOS memory APIs.
2017-05-04DRTVWR-418, MAINT-6996: On Mac, obtain total mem, not resident mem.Nat Goodspeed
The LLMemory method getCurrentRSS() is defined to return the "resident set size," but in fact on Windows it returns the WorkingSetSize -- and that's actually what callers want from it: the total memory consumed by the application for statistics purposes. It's not really clear what users gain by knowing how much of that is resident in real memory, versus the total consumption. So despite the commentation and the method name itself, on Mac make it return the virtual size consumed.
2017-05-02DRTVWR-418, MAINT-6996: Update Mac LLMemory::getCurrentRSS().Nat Goodspeed
Evidently the Mac implementation of LLMemory::getCurrentRSS() goes back to OS X 10.3, because there was a helpful comment of the form: ------ The API used here is not capable of dealing with 64-bit memory sizes, but is available before 10.4. Once we start requiring 10.4, we can use the updated API, which looks like this: [new current implementation] Of course, this doesn't gain us anything unless we start building the viewer as a 64-bit executable, since that's the only way for our memory allocation to exceed 2^32. ------ Hey, guess what, we're building 64-bit viewers now! Thank you, whoever thoughtfully noted that, both for calling out the issue and sparing us the research. (The comment goes back to Subversion days, so hg blame shows only the merge-to-release changeset.)
2017-05-02DRTVWR-418, MAINT-6996: Rationalize LLMemory wrt 64-bit support.Nat Goodspeed
There were two distinct LLMemory methods getCurrentRSS() and getWorkingSetSize(). It was pointless to have both: on Windows they were completely redundant; on other platforms getWorkingSetSize() always returned 0. (Amusingly, though the Windows implementations both made exactly the same GetProcessMemoryInfo() call and used exactly the same logic, the code was different in the two -- as though the second was implemented without awareness of the first, even though they were adjacent in the source file.) One of the actual MAINT-6996 problems was due to the fact that getWorkingSetSize() returned U32, where getCurrentRSS() returns U64. In other words, getWorkingSetSize() was both useless *and* wrong. Remove it, and change its one call to getCurrentRSS() instead. The other culprit was that in several places, the 64-bit WorkingSetSize returned by the Windows GetProcessMemoryInfo() call (and by getCurrentRSS()) was explicitly cast to a 32-bit data type. That works only when explicitly or implicitly (using LLUnits type conversion) scaling the value to kilobytes or megabytes. When the size in bytes is desired, use 64-bit types instead. In addition to the symptoms, LLMemory was overdue for a bit of cleanup. There was a 16K block of memory called reserveMem, the comment on which read: "reserve 16K for out of memory error handling." Yet *nothing* was ever done with that block! If it were going to be useful, one would think someone would at some point explicitly free the block. In fact there was a method freeReserve(), apparently for just that purpose -- which was never called. As things stood, reserveMem served only to *prevent* the viewer from ever using that chunk of memory. Remove reserveMem and the unused freeReserve(). The only function of initClass() and cleanupClass() was to allocate and free reserveMem. Remove initClass(), cleanupClass() and the LLCommon calls to them. In a similar vein, there was an LLMemoryInfo::getPhysicalMemoryClamped() method that returned U32Bytes. Its job was simply to return a size in bytes that could fit into a U32 data type, returning U32_MAX if the 64-bit value exceeded 4GB. Eliminate that; change all its calls to getPhysicalMemoryKB() (which getPhysicalMemoryClamped() used internally anyway). We no longer care about any platform that cannot handle 64-bit data types.
2016-11-22DRTVWR-418: Use uintptr_t when casting pointers to ints.Nat Goodspeed
LLPrivateMemoryPool and LLPrivateMemoryPoolManager have assumed that it's always valid to cast a pointer to U32. With 64-bit pointers, no longer true.
2015-11-10remove execute permission from many files that should not have itOz Linden
2015-04-27MAINT-5042 FIXED SL Viewer Closes Unexpectedly in specific area with high ↵ruslantproductengine
RenderVolumeLODFactor - fix for review - fix in buffer overrun detector
2014-10-28MAINT-4435 FIXED build fix patchset2ruslantproductengine
2014-10-27MAINT-4435 FIXED fix in llvolume.cpp Perform full build if number of verticesruslantproductengine
less than allowed. Changes in all other files relate auxiliary methods for catching similar bugs in future.
2013-09-07added memory usage and occlusion events to tracesRichard Linden
renamed "current" to "primary" when referring to accumulators
2013-08-26removed some unecessary template parameters from LLUnit member functionsRichard Linden
forced unit conversion code to inline unit conversion now no longer converts all the way to base and back, but tries to find equivalent units as early as possible fixed another llinfos instance scene monitor now outputs n/a for invalid samples
2013-08-21SH-4433 WIP Interesting: Statistics > Ping Sim is always 0 msRichard Linden
made getPrimaryAccumulator return a reference since it was an always non-null pointer changed unit conversion to perform lazy division in order to avoid truncation of timer values
2013-08-20BUILDFIX: unit assignment errorRichard Linden
2013-08-18SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 msRichard Linden
continued conversion to units system made units perform type promotion correctly and preserve type in arithmetic e.g. can now do LLVector3 in units added typedefs for remaining common unit types, including implicits
2013-08-16SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 msRichard Linden
converted many values over to units system in effort to track down source of 0 ping
2013-08-09second phase summer cleaningRichard Linden
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-07-08SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics ↵Richard Linden
console added percentage/ratio units added auto-range and auto tick calculation to stat bar to automate display stats
2013-06-05merge with viewer-releaseRichard Linden
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2012-11-19merge with viewer-developmentRichard Linden
2012-11-14SH-3406 WIP convert fast timers to lltrace systemRichard Linden
cleaning up build moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc streamlined Time class and consolidated functionality in BlockTimer class llfasttimer is no longer included via llstring.h, so had to add it manually in several places
2012-10-11MAINT-1684: Correcting the calls to ll_aligned_free() which should have ↵William Todd Stinson
actually been to ll_aligned_free_16().
2012-10-11MAINT-1684: Attempt at correcting the linux crash on startup. Replacing the ↵William Todd Stinson
memory allocations and frees in the LLPrivateMemoryPool with aligned memory allocations and frees.
2012-09-12initial attempt to restore changes that make removing tcmalloc possible; not ↵Oz Linden
tested
2012-09-10Backing out the changes contributing to DRTVWR-167 and DRTVWR-179 from the ↵William Todd Stinson
repository.
2012-07-11Pull in viewer-development because it's painful. Merge with runitai's help.simon@Simon-PC.lindenlab.com
2012-01-04SH-2789 WIP - stricter calling of memcpyNonAliased16Brad Payne (Vir Linden)
2011-12-19SH-2789 WIP - various fixes to force 16-byte alignmentBrad Payne (Vir Linden)
2011-11-22trivial: update the memory pool log info to the latest.Xiaohong Bao
2011-10-31mergeBrad Payne (Vir Linden)
2011-10-25fix for SH-2624: crash at LLPrivateMemoryPoolManager::freeMem: ASSERT (!addr)Xiaohong Bao
2011-10-17merge changes for storm-1651Oz Linden
2011-10-14b782a75c99e6 backout cleanupDave Parks
2011-10-10fix for SH-2464: Crash on exit in LLPrivateMemoryPoolManager::freeMemXiaohong Bao
2011-09-07fix for VWR-26864: Recent commit to Snowstorm project introduces frequent ↵Xiaohong Bao
errors and crashes associated with private memory pool.
2011-09-02re-write the hash table code to eliminate potential flaws and simplify the ↵Xiaohong Bao
implementation.
2011-07-20add a debug setting "MemoryPrivatePoolEnabled" to turn on/off private memory ↵Xiaohong Bao
pool.
2011-07-20fix a merge errorXiaohong Bao
2011-07-19fix for memory alignment to 16 bytes.Xiaohong Bao
2011-07-15Merge from viewer-developmentXiaohong Bao
2011-05-11fix a crashXiaohong Bao
2011-05-11fix a crashXiaohong Bao
2011-05-10fix a linux compiling error.Xiaohong Bao
2011-05-10add debug mode to track the memory allocation/deallocation.Xiaohong Bao
2011-04-04fix an issue on mac and linux, also fix an assertion.Xiaohong Bao
2011-04-04fix the bug for mac and linux of continuously adjusting memory.Xiaohong Bao
2011-02-24fix the compiling error: "free" is defined and in use globally.Xiaohong Bao
2011-02-23add types to LLPrivateMemoryPoolXiaohong Bao