<commit_before>/*****  VTransientServicesForBatchvision Implementation  *****/

#define FacilityName vtRANSIENTsERVICESfORbATCHVISION

/************************
 ************************
 *****  Interfaces  *****
 ************************
 ************************/

/********************
 *****  System  *****
 ********************/

#include "Vk.h"

#include "VkStatus.h"

#if defined(_WIN32)
#include <malloc.h>
#endif
#if defined (__linux__) || defined (sun)
#include <sys/resource.h>
#endif

/******************
 *****  Self  *****
 ******************/

#include "VTransientServicesForBatchvision.h"

/************************
 *****  Supporting  *****
 ************************/

#include "m.h"

#include "venvir.h"
#include "verr.h"
#include "vfac.h"
#include "vstdio.h"
#include "vutil.h"

#include "V_VAllocator.h"
#include "VOutputBuffer.h"


/**************************
 **************************
 *****  Construction  *****
 **************************
 **************************/

VTransientServicesForBatchvision::VTransientServicesForBatchvision ()
    : m_sTotalMemoryAllocation 			(0)
    , m_sTotalMemoryAllocationHighWaterMark	(0)
    , m_sMemoryAllocationLimit			(0)
    , m_iErrorCount				(0)
    , m_sInitialGCThreshold			(static_cast<V::U64>(4096) * 1024 * 1024 * 1024)
    , m_sGCThreshold				(static_cast<V::U64>(4096) * 1024 * 1024 * 1024)
    , m_sGCSpread				(256 * 1024 * 1024)
{
#if defined (__linux__) || defined (sun)

    // Don't allow unlimited datasize. If unlimited, fall back to 2 GB ..
    // Any finite limit is acceptable.

    struct rlimit datasize;
    if (-1 == getrlimit (RLIMIT_DATA, &datasize) ||  RLIM_INFINITY == datasize.rlim_cur){
	m_sMemoryAllocationLimit = 0x80000000;
    } else {
	m_sMemoryAllocationLimit = datasize.rlim_cur;
    }
    datasize.rlim_cur = RLIM_INFINITY;
    setrlimit (RLIMIT_DATA, &datasize);
    enableStackDumps (true);
#endif
    char	 *pEnvVarValue;
    unsigned int iValue;
    if (IsntNil (pEnvVarValue = getenv ("VisionLogPath"))) {
	updateUsageLogSwitch (true);<commit_msg>Duplicate ad5c6309e763f9112e3c138beeb4b3fb101b6f4c changes under 8.1.<commit_after>/*****  VTransientServicesForBatchvision Implementation  *****/

#define FacilityName vtRANSIENTsERVICESfORbATCHVISION

/************************
 ************************
 *****  Interfaces  *****
 ************************
 ************************/

/********************
 *****  System  *****
 ********************/

#include "Vk.h"

#include "VkStatus.h"

#if defined(_WIN32)
#include <malloc.h>
#endif
#if defined (__linux__) || defined (sun)
#include <sys/resource.h>
#endif

/******************
 *****  Self  *****
 ******************/

#include "VTransientServicesForBatchvision.h"

/************************
 *****  Supporting  *****
 ************************/

#include "m.h"

#include "venvir.h"
#include "verr.h"
#include "vfac.h"
#include "vstdio.h"
#include "vutil.h"

#include "V_VAllocator.h"
#include "VOutputBuffer.h"


/**************************
 **************************
 *****  Construction  *****
 **************************
 **************************/

VTransientServicesForBatchvision::VTransientServicesForBatchvision ()
    : m_sTotalMemoryAllocation 			(0)
    , m_sTotalMemoryAllocationHighWaterMark	(0)
    , m_sMemoryAllocationLimit			(0)
    , m_iErrorCount				(0)
    , m_sInitialGCThreshold			(static_cast<V::U64>(4096) * 1024 * 1024 * 1024)
    , m_sGCThreshold				(static_cast<V::U64>(4096) * 1024 * 1024 * 1024)
    , m_sGCSpread				(256 * 1024 * 1024)
{
#if defined (__linux__) || defined (sun)

    // Don't allow unlimited datasize. If unlimited, fall back to 2 GB ..
    // Any finite limit is acceptable.

    struct rlimit datasize;
    if (-1 == getrlimit (RLIMIT_DATA, &datasize) ||  RLIM_INFINITY == datasize.rlim_cur){
	m_sMemoryAllocationLimit = getenv ("VisionDataLimitDisabled") ? 0xffffffff00000000ull :  0x80000000;
    } else {
	m_sMemoryAllocationLimit = datasize.rlim_cur;
    }
    datasize.rlim_cur = RLIM_INFINITY;
    setrlimit (RLIMIT_DATA, &datasize);
    enableStackDumps (true);
#endif
    char	 *pEnvVarValue;
    unsigned int iValue;
    if (IsntNil (pEnvVarValue = getenv ("VisionLogPath"))) {
	updateUsageLogSwitch (true);
{'fraction_non_alphanumeric': 0.27599243856332706, 'fraction_numerical': 0.03827977315689981, 'mean_word_length': 4.774897680763984, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '828685', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1402, 'n_words': 256}