Commit Graph

83 Commits (40b39f99900cba7c86e11e8bd2d1a704e68f774f)

Author SHA1 Message Date
Graham Linden 7136956b90 Use more typedefs to simplify sync between viewer and sim env settings code. 2018-06-02 23:28:48 +01:00
Andrey Kleshchev 6e445e82e2 MAINT-8091 Removed deprecated and unused private memory pooling 2018-01-30 14:03:26 +00:00
Nat Goodspeed 9fa131b088 DRTVWR-418, MAINT-6996: Update Mac mem queries (per Drake Arconis)
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-10 14:19:44 -04:00
Nat Goodspeed 49cfd6d991 DRTVWR-418, MAINT-6996: On Mac, obtain total mem, not resident mem.
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-04 18:13:56 -04:00
Nat Goodspeed 2bb19aec98 DRTVWR-418, MAINT-6996: Update Mac LLMemory::getCurrentRSS().
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-02 11:05:13 -04:00
Nat Goodspeed 52899ed62a DRTVWR-418, MAINT-6996: Rationalize LLMemory wrt 64-bit support.
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.
2017-05-02 10:51:18 -04:00
Nat Goodspeed 40f7501319 DRTVWR-418: Use uintptr_t when casting pointers to ints.
LLPrivateMemoryPool and LLPrivateMemoryPoolManager have assumed that it's
always valid to cast a pointer to U32. With 64-bit pointers, no longer true.
2016-11-22 08:35:41 -05:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
ruslantproductengine 75ffe90b0c MAINT-5042 FIXED SL Viewer Closes Unexpectedly in specific area with high RenderVolumeLODFactor
- fix for review
- fix in buffer overrun detector
2015-04-27 18:21:39 +03:00
ruslantproductengine edb7e3450f MAINT-4435 FIXED build fix patchset2 2014-10-28 17:12:49 +02:00
ruslantproductengine 366bcd0cbc MAINT-4435 FIXED fix in llvolume.cpp Perform full build if number of vertices
less than allowed. Changes in all other files relate auxiliary methods for
catching similar bugs in future.
2014-10-27 17:10:08 +02:00
Richard Linden 3fd68662f2 added memory usage and occlusion events to traces
renamed "current" to "primary" when referring to accumulators
2013-09-07 21:16:39 -07:00
Richard Linden 8535b87544 removed some unecessary template parameters from LLUnit member functions
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-26 18:00:24 -07:00
Richard Linden 2c6bc5afa5 SH-4433 WIP Interesting: Statistics > Ping Sim is always 0 ms
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-21 14:06:57 -07:00
Richard Linden 6d9af37406 BUILDFIX: unit assignment error 2013-08-20 12:10:05 -07:00
Richard Linden 612892b45a SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms
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-18 22:30:27 -07:00
Richard Linden 25937040de SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms
converted many values over to units system in effort to track down
source of 0 ping
2013-08-16 12:38:12 -07:00
Richard Linden e340009fc5 second phase summer cleaning
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-08-09 17:11:19 -07:00
Richard Linden d122318bef SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics console
added percentage/ratio units
added auto-range and auto tick calculation to stat bar to automate display stats
2013-07-08 00:55:17 -07:00
Richard Linden 0a96b47663 merge with viewer-release 2013-06-05 19:05:43 -07:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Richard Linden c0224cc47a merge with viewer-development 2012-11-19 19:06:36 -08:00
Richard Linden 9d77e030d9 SH-3406 WIP convert fast timers to lltrace system
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-11-14 23:52:27 -08:00
William Todd Stinson e1bc3cb096 MAINT-1684: Correcting the calls to ll_aligned_free() which should have actually been to ll_aligned_free_16(). 2012-10-11 18:25:13 -07:00
William Todd Stinson 572d4bc071 MAINT-1684: Attempt at correcting the linux crash on startup. Replacing the memory allocations and frees in the LLPrivateMemoryPool with aligned memory allocations and frees. 2012-10-11 16:47:16 -07:00
Oz Linden 97d969a338 initial attempt to restore changes that make removing tcmalloc possible; not tested 2012-09-12 14:36:37 -04:00
William Todd Stinson a766e26db4 Backing out the changes contributing to DRTVWR-167 and DRTVWR-179 from the repository. 2012-09-10 10:37:02 -07:00
simon@Simon-PC.lindenlab.com 173d0fa213 Pull in viewer-development because it's painful. Merge with runitai's help. 2012-07-11 16:15:23 -07:00
Brad Payne (Vir Linden) 1435a8b9e6 SH-2789 WIP - stricter calling of memcpyNonAliased16 2012-01-04 15:21:23 -05:00
Brad Payne (Vir Linden) 9c2e0d84f8 SH-2789 WIP - various fixes to force 16-byte alignment 2011-12-19 18:17:18 -05:00
Xiaohong Bao 9850e09f76 trivial: update the memory pool log info to the latest. 2011-11-22 11:51:49 -07:00
Brad Payne (Vir Linden) 51c7887f8d merge 2011-10-31 11:35:22 -04:00
Xiaohong Bao 0637fe27bc fix for SH-2624: crash at LLPrivateMemoryPoolManager::freeMem: ASSERT (!addr) 2011-10-25 22:53:40 -06:00
Oz Linden 9785506d56 merge changes for storm-1651 2011-10-17 16:27:18 -04:00
Dave Parks 4924f0c99b b782a75c99e6 backout cleanup 2011-10-14 12:38:48 -05:00
Xiaohong Bao 897972636d fix for SH-2464: Crash on exit in LLPrivateMemoryPoolManager::freeMem 2011-10-10 16:31:56 -06:00
Xiaohong Bao 616a7b549d fix for VWR-26864: Recent commit to Snowstorm project introduces frequent errors and crashes associated with private memory pool. 2011-09-07 23:23:08 -06:00
Xiaohong Bao ba2ae6bc95 re-write the hash table code to eliminate potential flaws and simplify the implementation. 2011-09-02 11:17:03 -06:00
Xiaohong Bao 48d949150c add a debug setting "MemoryPrivatePoolEnabled" to turn on/off private memory pool. 2011-07-20 16:05:19 -06:00
Xiaohong Bao 5ee90d7848 fix a merge error 2011-07-20 10:24:44 -06:00
Xiaohong Bao 76eca5d0bc fix for memory alignment to 16 bytes. 2011-07-19 23:17:55 -06:00
Xiaohong Bao d951267467 Merge from viewer-development 2011-07-15 12:14:34 -06:00
Xiaohong Bao d31e673537 fix a crash 2011-05-11 14:41:23 -06:00
Xiaohong Bao d696977c70 fix a crash 2011-05-11 14:23:15 -06:00
Xiaohong Bao 39f033a013 fix a linux compiling error. 2011-05-10 21:13:20 -06:00
Xiaohong Bao b594d3b04d add debug mode to track the memory allocation/deallocation. 2011-05-10 21:02:20 -06:00
Xiaohong Bao 17854c4e87 fix an issue on mac and linux, also fix an assertion. 2011-04-04 14:40:07 -06:00
Xiaohong Bao a40ee94cd6 fix the bug for mac and linux of continuously adjusting memory. 2011-04-04 10:00:29 -06:00
Xiaohong Bao fc106df530 fix the compiling error: "free" is defined and in use globally. 2011-02-24 19:47:55 -07:00
Xiaohong Bao 108980f68c add types to LLPrivateMemoryPool 2011-02-23 17:53:08 -07:00