Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20151202の宿題です。 #368

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions 20151202/src/enshu_20151202/src/GCTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ void *_ThreadStart(void *arg){

bool do_delete = true;


#include <boost/shared_ptr.hpp>
typedef vector<int> Elem;
typedef vector<int>* ElemPtr;
typedef vector<ElemPtr>* ElemPtrVec;
typedef boost::shared_ptr<vector<int> > ElemPtr;
typedef boost::shared_ptr<vector<ElemPtr> > ElemPtrVec;

class Mutator : public Thread {
bool loop;
Expand All @@ -55,8 +55,8 @@ class Mutator : public Thread {
ElemPtrVec v = ElemPtrVec(new vector<ElemPtr>());
// mutator
for (int k = 0; k < 2000; k++) {
v->push_back(ElemPtr(new Elem(1000000)));
}
v->push_back(ElemPtr(new Elem(1000000)));
}
//
#if 0 // usually we need this
if ( do_delete ) {
Expand All @@ -71,7 +71,7 @@ class Mutator : public Thread {
cout << '\b' << "-";
}
}

void end() {
loop = false;
}
Expand Down Expand Up @@ -110,19 +110,19 @@ class Sort : public Thread {
for (int i = a->size()-1; --i>=0; ) {
bool swapped = false;
for (int j = 0; j<i; j++) {
if ((*a)[j] > (*a)[j+1]) {
int T = (*a)[j];
(*a)[j] = (*a)[j+1];
(*a)[j+1] = T;
swapped = true;
}
}
if ( i % 10 == 0 ) print_arr(*a);
if (!swapped)
return;
}
}
if ((*a)[j] > (*a)[j+1]) {
int T = (*a)[j];
(*a)[j] = (*a)[j+1];
(*a)[j+1] = T;
swapped = true;
}
}
if ( i % 10 == 0 ) print_arr(*a);
if (!swapped)
return;
}
}

public:
vector<int> arr;
Sort(){}
Expand Down
11 changes: 11 additions & 0 deletions 20151202/src/enshu_20151202/src/GCTest.gc.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Java HotSpot(TM) 64-Bit Server VM (25.66-b17) for linux-amd64 JRE (1.8.0_66-b17), built on Oct 6 2015 17:28:34 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 16118240k(13032056k free), swap 16456700k(15018860k free)
CommandLine flags: -XX:InitialHeapSize=257891840 -XX:MaxHeapSize=4126269440 -XX:+PrintGC -XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC
0.115: [GC (Allocation Failure) 63488K->48885K(241664K), 0.0484713 secs]
0.229: [GC (Allocation Failure) 112373K->101178K(305152K), 0.0638401 secs]
0.424: [GC (Allocation Failure) 228154K->100257K(305152K), 0.0121071 secs]
0.567: [GC (Allocation Failure) 227233K->205178K(459776K), 0.1039950 secs]
0.672: [Full GC (Ergonomics) 205178K->114013K(574464K), 0.4412598 secs]
1.375: [GC (Allocation Failure) 367965K->323898K(578560K), 0.1781392 secs]
1.554: [Full GC (Ergonomics) 323898K->127263K(742400K), 0.6877298 secs]
2.488: [GC (Allocation Failure) 381215K->330427K(1015296K), 0.1638731 secs]
18 changes: 18 additions & 0 deletions 20151202/src/enshu_20151202/src/GCTest.incgc.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Java HotSpot(TM) 64-Bit Server VM (25.66-b17) for linux-amd64 JRE (1.8.0_66-b17), built on Oct 6 2015 17:28:34 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 16118240k(13056608k free), swap 16456700k(15039916k free)
CommandLine flags: -XX:+CMSIncrementalMode -XX:InitialHeapSize=257891840 -XX:MaxHeapSize=4126269440 -XX:MaxNewSize=697933824 -XX:MaxTenuringThreshold=6 -XX:OldPLABSize=16 -XX:+PrintGC -XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
0.129: [GC (Allocation Failure) 67200K->68951K(243520K), 0.2593494 secs]
0.458: [GC (Allocation Failure) 136151K->146087K(243520K), 0.0922372 secs]
0.550: [GC (CMS Initial Mark) 147390K(243520K), 0.0031510 secs]
0.623: [GC (Allocation Failure) 213287K->223366K(291136K), 0.1124647 secs]
0.807: [GC (Allocation Failure) 290566K->300877K(368512K), 0.1206776 secs]
0.998: [GC (Allocation Failure) 368077K->378530K(446272K), 0.1141197 secs]
1.182: [GC (Allocation Failure) 445730K->455895K(523648K), 0.1140045 secs]
1.366: [GC (Allocation Failure) 523095K->533099K(600832K), 0.1142035 secs]
1.551: [GC (Allocation Failure) 600299K->610404K(678016K), 0.1132424 secs]
1.735: [GC (Allocation Failure) 677604K->687873K(755584K), 0.1233269 secs]
1.931: [GC (Allocation Failure) 755073K->764441K(832192K), 0.1112849 secs]
2.113: [GC (Allocation Failure) 831641K->841309K(908992K), 0.1150450 secs]
2.299: [GC (Allocation Failure) 908509K->916919K(984640K), 0.1114734 secs]
2.480: [GC (Allocation Failure) 984119K->994766K(1062400K), 0.1122409 secs]
2.660: [GC (Allocation Failure) 1061966K->1072492K(1140160K), 0.1215817 secs]