Commit Graph

112 Commits (8a13530ce4eeb481ee467fd3ec54f1ed7e9f632a)

Author SHA1 Message Date
Andrey Kleshchev 6e445e82e2 MAINT-8091 Removed deprecated and unused private memory pooling 2018-01-30 14:03:26 +00: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
Nat Goodspeed 6cc4a8dcd2 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2016-11-03 09:31:15 -04:00
Oz Linden a5adabb4f6 add protections against failed memory allocations in VBO and aligned memory 2016-09-06 10:04:19 -04:00
callum_linden 9c4ed8d113 Automated merge with tip of viewer-release to pick up 4.0.5 2016-05-19 11:00:03 -07:00
callum_linden b50df60aa1 DRTVWR-418 remove vestiges of TCMALLOC and GooglePerfTools from the viewer 2016-04-21 16:13:39 -07:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
AndreyL ProductEngine f64a10ca8f Merge downstream code, version 3.8.5 2015-09-30 01:21:04 +03: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
andreykproductengine 1dd7e76908 Merge with viewer-release and become 3.7.28 2015-04-14 18:53:17 +03: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
Graham Linden 96a3a858b4 Mergeville 2014-08-29 11:31:51 -07:00
Aura Linden 2121ffcdab Fixed assert in llmemory.h for adjacent memory locations. 2014-07-11 16:46:18 -07:00
Graham Linden a815ad481a Mergeup to 3.7.9 viewer-release 2014-05-29 04:54:58 -07:00
Graham Linden 5cbcff7b40 Appease GCC 4.6.1 syntax problems with uintptr_t in alignment asserts 2014-04-22 22:19:39 -07:00
Richard Linden a8192fbf60 accidentally left _CrtCheckMemory defined in non-Windows builds 2014-02-06 13:14:40 -08:00
Richard Linden 3040b429a3 added LL_TRACE_ENABLED to allow disabling of lltrace 2014-02-06 11:27:16 -08:00
Richard Linden 1acceb3633 changed ll_aligned_(malloc|free) to take alignment size as a template argument 2013-10-14 10:18:41 -07:00
Richard Linden 80dfbbaacd merge from viewer-release 2013-10-08 11:59:24 -07:00
Richard Linden e0a443f5a6 BUILDFIX: fix for mac builds
also, fixed alignment of tick labels on stat bars
2013-09-27 11:18:39 -07:00
Richard Linden 053d97db1b better memory usage for LLTrace (tighter packing of recording arrays)
removed complicated and unnecessary fast timer gapless handoff logic (it should be gapless anyway)
improved MemTrackable API, better separation of shadow and footprint
added memory usage stats to floater_stats.xml
2013-09-25 19:12:35 -07:00
Richard Linden a7aed07a5b broke out llunit.h into llunittype.h and llunits.h for unit declarations
changed unit declarations macros to make a lot more sense
2013-08-27 13:41:19 -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 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
simon ee2fce8790 Merge downstream code and viewer-beta 2013-05-09 14:10:45 -07:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Graham Madarasz (Graham Linden) ebb57d28ef Resurrect merge victim...restoring ll_memcpy_nonaliased_aligned_16 definition 2013-03-13 16:40:06 -07:00
Graham Madarasz (Graham Linden) 9a811855b9 Merge 2013-03-13 16:16:17 -07:00
Graham Madarasz (Graham Linden) bba84a3fa9 Cleanup per code review of prev change with DaveP 2013-03-13 13:38:30 -07:00
Graham Madarasz (Graham Linden) 5d2fea6262 Move fast memcpy to llcommon and use it in llalignedarray pushback on all platforms. Code Review: DaveP 2013-03-13 10:42:40 -07:00
Graham Madarasz 6613d80d72 Clean up moving llalignedarray and fast memcpy to llcommon 2013-03-11 14:19:05 -07:00
Graham Madarasz 6ac6736994 Move 16b aligned memcpy and alignment utilities to llmem in llcommon for easier use elsewhere 2013-03-11 16:00:25 -07:00
Dave Parks 609ed855e1 MAINT-2371 More optimizations.
Reviewed by Graham
2013-03-04 18:01:42 -06:00
Richard Linden 1a888f786c SH-3468 WIP add memory tracking base class
made LLTrace::MemTrackable support custom alignment
LLDrawable now uses MemTrackable new and delete operators
2013-01-09 23:05:07 -08:00
Richard Linden b2197101c4 SH-3468 WIP add memory tracking base class
fix for compile error on windows
ignore stdint.h even though VS2010 provides it
2013-01-04 13:04:09 -08:00
Andrew Meadows 6e82bb7789 fixing linux compile errors for llcommon after LLTrace work 2013-01-03 22:34:34 +00:00
Richard Linden 5d51175cd7 SH-3406 WIP convert fast timers to lltrace system
fixes to merge
2012-11-20 15:55:04 -08:00
Richard Linden c0224cc47a merge with viewer-development 2012-11-19 19:06:36 -08:00
Dave Parks c431ddf629 Automated merge with http://bitbucket.org/lindenlab/viewer-development 2012-11-08 13:05:29 -06:00
William Todd Stinson 11017315e6 MAINT-1753: Correcting behavior of ll_aligned_realloc_16() on Linux to avoid memory corruption in the case that the new memory size requested is smaller than the old memory size. Also, adding check to ensure that the aligned malloc returns a non-null value before memcopying. 2012-10-18 17:36:57 -07:00
simon@Simon-PC.lindenlab.com d6e3b0445a Merge in viewer-development code and fix build 2012-10-15 14:23:29 -07:00
Oz Linden 07899b2820 merge changes for DRTVWR-222 2012-10-04 20:12:51 -04:00
Dave Parks 05dbd7dafe Instrument debug builds on windows to help track down source of heap corruption 2012-10-02 16:06:14 -05:00
Richard Linden 735fde8c74 SH-3275 WIP Run viewer metrics for object update messages
added LLThreadLocalPtr
broke llmutex out into llmutex.h
got primary sampling buffer under thread local storage
2012-09-21 18:52:08 -07:00
Dave Parks 9ec263d2f1 MAINT-1503 Minimal set of changes needed to safely disable tcmalloc 2012-09-12 15:44:36 -05:00
Oz Linden 97d969a338 initial attempt to restore changes that make removing tcmalloc possible; not tested 2012-09-12 14:36:37 -04:00
Dave Parks 7b6e81ab03 Handle the NULL case on ll_aligned_realloc_16 on linux 2012-09-12 11:46:43 -05:00