Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » Freeze up on sample?
Freeze up on sample? [message #121122] Mon, 21 January 2008 09:36 Go to next message
Eclipse User
Originally posted by: ck2329.mail.ru

Im running Eclipse 3.3 with TPTP 4.4.1 on Win32 (TPTPAllInOne package) ,
Pentium IV with HT, 3.0 MGhz, 2 GB RAM

And im facing with following trouble:

When im running my example - TPTP works just for 1 min(that is longest run
- ussually it works less) - then it freezes. What can be wrong ?

Example code:


class Q {

int n;
boolean valueset = false;

synchronized int get() {
if (!valueset)
try {
wait();
}
catch (InterruptedException e) {
System.out.println("InterruptedException caught");
}

System.out.println("Got: " + n);
valueset=false;
notify();

return n;
}
synchronized void put(int n) {
if (valueset)
try {
wait();
}
catch(InterruptedException e) {
System.out.println("InterruptedException caught");
}
this.n=n;
valueset=true;
System.out.println("Put: " + n);
notify();
}
}

class Producer implements Runnable {
Q q;

Producer(Q q) {
this.q=q;
new Thread(this, "Producer").start();
}
public void run() {
int i=0;

while(true) {
q.put(i++);
}
}
}

class Consumer implements Runnable {
Q q;

Consumer(Q q) {
this.q=q;
new Thread(this, "Consumer").start();
}

public void run() {
while(true) {
q.get();
}
}
}

class PCFixed {
public static void main(String args[]) {
Q q = new Q();

new Producer(q);
new Consumer(q);
System.out.println("Press Control-C to stop");
}
}
Re: Freeze up on sample? [message #121166 is a reply to message #121122] Mon, 21 January 2008 15:00 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf Yaffe
Messages: 333
Registered: July 2009
Senior Member
Which data collector/profiler are you using (execution/memory/thread)?
Which filters?

Thanks,
Asaf


Andrew V. Novoselsky wrote:
> Im running Eclipse 3.3 with TPTP 4.4.1 on Win32 (TPTPAllInOne package) ,
> Pentium IV with HT, 3.0 MGhz, 2 GB RAM
>
> And im facing with following trouble:
> When im running my example - TPTP works just for 1 min(that is longest
> run - ussually it works less) - then it freezes. What can be wrong ?
>
> Example code:
>
>
> class Q {
>
> int n;
> boolean valueset = false;
>
> synchronized int get() {
> if (!valueset) try {
> wait();
> }
> catch (InterruptedException e) {
> System.out.println("InterruptedException caught");
> }
>
> System.out.println("Got: " + n);
> valueset=false;
> notify();
>
> return n;
> }
> synchronized void put(int n) {
> if (valueset)
> try {
> wait();
> }
> catch(InterruptedException e) {
> System.out.println("InterruptedException caught");
> }
> this.n=n;
> valueset=true;
> System.out.println("Put: " + n);
> notify();
> }
> }
>
> class Producer implements Runnable {
> Q q;
>
> Producer(Q q) {
> this.q=q;
> new Thread(this, "Producer").start();
> }
> public void run() {
> int i=0;
>
> while(true) {
> q.put(i++);
> }
> }
> }
>
> class Consumer implements Runnable {
> Q q;
>
> Consumer(Q q) {
> this.q=q;
> new Thread(this, "Consumer").start();
> }
>
> public void run() {
> while(true) {
> q.get();
> }
> }
> }
>
> class PCFixed {
> public static void main(String args[]) {
> Q q = new Q();
>
> new Producer(q);
> new Consumer(q);
> System.out.println("Press Control-C to stop");
> }
> }
>
Re: Freeze up on sample? [message #121185 is a reply to message #121166] Tue, 22 January 2008 09:37 Go to previous message
Eclipse User
Originally posted by: ck2329.mail.ru

Actually it happends on all types of analysis.
Now i tried with Thread Analysis. I have 72146 events and ~36MB processed
data in 49 secs - than i got hand up.
regading filters - i dont know how to specify filter for Thread Analysis
Previous Topic:TPTP porting to embedded platforms
Next Topic:Unable to profile Java application
Goto Forum:
  


Current Time: Sat Oct 25 21:18:33 GMT 2014

Powered by FUDForum. Page generated in 0.02004 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software