-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
61 lines (53 loc) · 1.66 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
plugins {
id 'java'
id 'application'
}
allprojects {
apply plugin: 'idea'
group 'uk.co.palmr'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
}
dependencies {
implementation 'org.apache.logging.log4j:log4j-api:2.11.1'
implementation 'org.apache.logging.log4j:log4j-core:2.11.1'
implementation 'org.apache.commons:commons-lang3:3.0'
implementation project(':QuestionableJniLib')
}
applicationName = 'OffHeapLeakExample'
mainClassName = "uk.co.palmr.offheapleakexample.Main"
applicationDefaultJvmArgs = [
'-Xms32m',
'-Xmx32m',
'-XX:NativeMemoryTracking=detail',
'-Dlog4j.configurationFile=resources/log4j.properties'
]
startScripts {
doLast {
def newEnvVars = "# Use jemalloc instead of glibc\n" +
"export LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision`\n" +
"\n" +
"# Use jemalloc profiling, memory profile dump every 30 mB, allocation sample every 128 kB\n" +
"export MALLOC_CONF=prof:true,lg_prof_interval:25,lg_prof_sample:17"
unixScript.text = unixScript.text.replace("MAX_FD=\"maximum\"", "MAX_FD=\"maximum\"\n\n$newEnvVars")
}
}
distributions {
main {
contents {
from('src/main/scripts') {
into {'bin'}
}
from('src/main/resources') {
into {'resources'}
}
from(tasks.getByPath(':QuestionableCLib:linkQuestionableCLibSharedLibrary')) {
duplicatesStrategy = 'INCLUDE'
into {'lib'}
}
}
}
}